Commit 2ffb795f authored by Olav Haugan's avatar Olav Haugan Committed by Greg Kroah-Hartman

staging: speakup: (coding style) Simplify comparisons to NULL

Fix checkpatch check notices by simplifying comparisons to NULL.
Signed-off-by: default avatarOlav Haugan <ohaugan@codeaurora.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6796cd84
...@@ -51,7 +51,7 @@ int spk_serial_synth_probe(struct spk_synth *synth) ...@@ -51,7 +51,7 @@ int spk_serial_synth_probe(struct spk_synth *synth)
if ((synth->ser >= SPK_LO_TTY) && (synth->ser <= SPK_HI_TTY)) { if ((synth->ser >= SPK_LO_TTY) && (synth->ser <= SPK_HI_TTY)) {
ser = spk_serial_init(synth->ser); ser = spk_serial_init(synth->ser);
if (ser == NULL) { if (!ser) {
failed = -1; failed = -1;
} else { } else {
outb_p(0, ser->port); outb_p(0, ser->port);
...@@ -272,7 +272,7 @@ void spk_reset_index_count(int sc) ...@@ -272,7 +272,7 @@ void spk_reset_index_count(int sc)
int synth_supports_indexing(void) int synth_supports_indexing(void)
{ {
if (synth->get_index != NULL) if (synth->get_index)
return 1; return 1;
return 0; return 0;
} }
...@@ -350,7 +350,7 @@ int synth_init(char *synth_name) ...@@ -350,7 +350,7 @@ int synth_init(char *synth_name)
int ret = 0; int ret = 0;
struct spk_synth *synth = NULL; struct spk_synth *synth = NULL;
if (synth_name == NULL) if (!synth_name)
return 0; return 0;
if (strcmp(synth_name, "none") == 0) { if (strcmp(synth_name, "none") == 0) {
...@@ -362,7 +362,7 @@ int synth_init(char *synth_name) ...@@ -362,7 +362,7 @@ int synth_init(char *synth_name)
mutex_lock(&spk_mutex); mutex_lock(&spk_mutex);
/* First, check if we already have it loaded. */ /* First, check if we already have it loaded. */
for (i = 0; i < MAXSYNTHS && synths[i] != NULL; i++) for (i = 0; i < MAXSYNTHS && synths[i]; i++)
if (strcmp(synths[i]->name, synth_name) == 0) if (strcmp(synths[i]->name, synth_name) == 0)
synth = synths[i]; synth = synths[i];
...@@ -421,7 +421,7 @@ void synth_release(void) ...@@ -421,7 +421,7 @@ void synth_release(void)
struct var_t *var; struct var_t *var;
unsigned long flags; unsigned long flags;
if (synth == NULL) if (!synth)
return; return;
spin_lock_irqsave(&speakup_info.spinlock, flags); spin_lock_irqsave(&speakup_info.spinlock, flags);
pr_info("releasing synth %s\n", synth->name); pr_info("releasing synth %s\n", synth->name);
...@@ -444,7 +444,7 @@ int synth_add(struct spk_synth *in_synth) ...@@ -444,7 +444,7 @@ int synth_add(struct spk_synth *in_synth)
int status = 0; int status = 0;
mutex_lock(&spk_mutex); mutex_lock(&spk_mutex);
for (i = 0; i < MAXSYNTHS && synths[i] != NULL; i++) for (i = 0; i < MAXSYNTHS && synths[i]; i++)
/* synth_remove() is responsible for rotating the array down */ /* synth_remove() is responsible for rotating the array down */
if (in_synth == synths[i]) { if (in_synth == synths[i]) {
mutex_unlock(&spk_mutex); mutex_unlock(&spk_mutex);
...@@ -471,11 +471,11 @@ void synth_remove(struct spk_synth *in_synth) ...@@ -471,11 +471,11 @@ void synth_remove(struct spk_synth *in_synth)
mutex_lock(&spk_mutex); mutex_lock(&spk_mutex);
if (synth == in_synth) if (synth == in_synth)
synth_release(); synth_release();
for (i = 0; synths[i] != NULL; i++) { for (i = 0; synths[i]; i++) {
if (in_synth == synths[i]) if (in_synth == synths[i])
break; break;
} }
for ( ; synths[i] != NULL; i++) /* compress table */ for ( ; synths[i]; i++) /* compress table */
synths[i] = synths[i + 1]; synths[i] = synths[i + 1];
module_status = 0; module_status = 0;
mutex_unlock(&spk_mutex); mutex_unlock(&spk_mutex);
......
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