Commit 06f6c8d4 authored by Sreya Mittal's avatar Sreya Mittal Committed by Greg Kroah-Hartman

staging: speakup: Clean up if tests

Put logical continuations on the next line;
remove useless parentheses;
and line up the tests.
Signed-off-by: default avatarSreya Mittal <sreyamittal5@gmail.com>
Acked-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 58b0de1c
...@@ -411,8 +411,8 @@ static char *next_specifier(char *input) ...@@ -411,8 +411,8 @@ static char *next_specifier(char *input)
next_percent = strchr(next_percent, '%'); next_percent = strchr(next_percent, '%');
if (next_percent) { if (next_percent) {
/* skip over doubled percent signs */ /* skip over doubled percent signs */
while ((next_percent[0] == '%') while (next_percent[0] == '%' &&
&& (next_percent[1] == '%')) next_percent[1] == '%')
next_percent += 2; next_percent += 2;
if (*next_percent == '%') if (*next_percent == '%')
found = 1; found = 1;
...@@ -549,10 +549,10 @@ ssize_t spk_msg_set(enum msg_index_t index, char *text, size_t length) ...@@ -549,10 +549,10 @@ ssize_t spk_msg_set(enum msg_index_t index, char *text, size_t length)
if (newstr) { if (newstr) {
memcpy(newstr, text, length); memcpy(newstr, text, length);
newstr[length] = '\0'; newstr[length] = '\0';
if ((index >= MSG_FORMATTED_START if (index >= MSG_FORMATTED_START &&
&& index <= MSG_FORMATTED_END) index <= MSG_FORMATTED_END &&
&& !fmt_validate(speakup_default_msgs[index], !fmt_validate(speakup_default_msgs[index],
newstr)) { newstr)) {
kfree(newstr); kfree(newstr);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment