staging: speakup: kobjects: Delete comparison
authorTamara Diaconita <diaconitatamara@gmail.com>
Tue, 7 Mar 2017 16:38:59 +0000 (18:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Mar 2017 13:29:40 +0000 (14:29 +0100)
Comparison to NULL is not necessary because 'if' statement tests if
'synth' is NULL anyway.

Delete comparison in 'if' structure to fix the checkpath.pl issue :
CHECK: Comparison to NULL could be written 'synth'.

Signed-off-by: Tamara Diaconita <diaconita.tamara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/speakup/kobjects.c

index a536288..9feb97d 100644 (file)
@@ -392,7 +392,7 @@ static ssize_t synth_store(struct kobject *kobj, struct kobj_attribute *attr,
                len--;
        new_synth_name[len] = '\0';
        spk_strlwr(new_synth_name);
-       if ((synth != NULL) && (!strcmp(new_synth_name, synth->name))) {
+       if (synth && (!strcmp(new_synth_name, synth->name))) {
                pr_warn("%s already in use\n", new_synth_name);
        } else if (synth_init(new_synth_name) != 0) {
                pr_warn("failed to init synth %s\n", new_synth_name);