staging/speakup/kobjects.c: Code improvement.
authorRaphael S.Carvalho <raphael.scarv@gmail.com>
Mon, 2 Sep 2013 22:20:18 +0000 (19:20 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Sep 2013 14:47:45 +0000 (07:47 -0700)
commitb71600bb4bc8591c9bc4234cc12b51d521444b1c
tree15a93d979db2c1eb8dad9f527fa556db1cbe494f
parentad6343a49ee637de6352af1dc519067b9591b710
staging/speakup/kobjects.c: Code improvement.

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>
drivers/staging/speakup/kobjects.c