summaryrefslogtreecommitdiff
path: root/drivers/staging/speakup/kobjects.c
AgeCommit message (Collapse)Author
2013-10-19Staging: speakup: replacing simple_strtoul with kstrtoulAshvini Varatharaj
Fix checkpatch warning: WARNING: simple_strtoul is obsolete, use kstrtoul instead Signed-off-by: Ashvini Varatharaj <ashvinivaratharaj@gmail.com> Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-17staging: speakup: kobjects.c: Use correct values when changing voice.Christopher Brannon
When a new voice is selected, we set volume and pitch appropriate for the voice. We need to use the numeric index corresponding to the voice when indexing into the volume and pitch tables, rather than the raw user input that was used to select the voice. Note that using the raw input can also lead to an invalid memory read in the case of invalid or malicious user input. Signed-off-by: Christopher Brannon <chris@the-brannons.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-17staging/speakup/kobjects.c: Code improvement.Raphael S.Carvalho
Well, there is no need to use strcmp since we can make a test of similar semantic by using the var_id field of param. I moved the test into the VAR_NUM:VAR_TIME case since VAR_STRING will never be "voice". spk_xlate isn't used anymore (in line 628), then there is no difference between using cp and buf in VAR_STRING case. Besides, buf is a const char and those changes remove one uneeded line. I created the function spk_reset_default_value because it clarifies the code and allows code reusing. Signed-off-by: Raphael S.Carvalho <raphael.scarv@gmail.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-22Staging: speakup/kobjects: Use NULL instead of 0Sachin Kamat
Use NULL instead of 0 for pointers. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16staging: speakup: kobjects: remove custom locking macrosWilliam Hubbs
Signed-off-by: William Hubbs <w.d.hubbs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-30staging: speakup: remove custom string_unescape_any_inplaceAndy Shevchenko
There is generic implementation of the function to unescape strings. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Samuel Thibault <samuel.thibault@ens-lyon.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: William Hubbs <w.d.hubbs@gmail.com> Cc: Chris Brannon <chris@the-brannons.com> Cc: Kirk Reiser <kirk@braille.uwo.ca> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-03-29staging: speakup: use native error codesAndy Shevchenko
The mapping as follows: E_RANGE -> ERANGE E_UNDEF -> ENODATA E_TOOLONG -> E2BIG SET_DEFAULT -> ERESTART As a side effect it fixes a bug in spk_var_store() where return code was mistakenly compared to negative value instead of positive. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-29staging: speakup: reuse native kernel functionsAndy Shevchenko
We have simple_strtoul and simple_strtol. Don't repeat their functionality here. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17Staging: speakup: kobjects.c: checkpatch.pl fixesLijo Antony
Fixed two "line over 80 characters" warnings reported by checkpatch.pl Signed-off-by: Lijo Antony <lijo.kernel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07staging: speakup: Prefix externally-visible symbolsSamuel Thibault
This prefixes all externally-visible symbols of speakup with "spk_". Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-11-26Staging: speakup: Use kmemdup rather than duplicating its implementationThomas Meyer
Use kmemdup rather than duplicating its implementation The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-20Staging: speakup: &&/|| confusion in silent_store()roel kluin
Fix test: the branch is always taken. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-10staging: speakup: fix failure handlingWilliam Hubbs
fix the failure handling in kobjects and the main function so that we release the virtual keyboard if we exit due to another failure. Signed-off-by: William Hubbs <w.d.hubbs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-19staging: speakup: fix leaks of sysfs groupsVasiliy Kulikov
speakup_kobj_init() and speakup_kobj_exit() didn't remove i18n_attr_group and main_attr_group sysfs groups. Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-12staging: speakup: kobjects.c: style fixesWilliam Hubbs
clean upd this file based on reports from checkpatch.pl Signed-off-by: William Hubbs <w.d.hubbs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-07Staging: add speakup to the staging directoryWilliam Hubbs
Speakup is a kernel based screen review package for the linux operating system. It allows blind users to interact with applications on the linux console by means of synthetic speech. The authors and maintainers of this code include the following: Kirk Reiser, Andy Berdan, John Covici, Brian and David Borowski, Christopher Brannon, Samuel Thibault and William Hubbs. Signed-off-by: William Hubbs <w.d.hubbs@gmail.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>