ALSA: timer: Adjust a condition check in snd_timer_resolution()
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 23 Aug 2017 07:45:06 +0000 (09:45 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 23 Aug 2017 08:37:15 +0000 (10:37 +0200)
The script "checkpatch.pl" pointed information out like the following.

ERROR: do not use assignment in if condition

Thus fix the affected source code place.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/timer.c

index a9b9a277e00c1bda4bd85038cc45842ac2425ee0..6051aed3197f02a1b2a5bc0bb3375bef08e0d47a 100644 (file)
@@ -393,7 +393,8 @@ unsigned long snd_timer_resolution(struct snd_timer_instance *timeri)
 
        if (timeri == NULL)
                return 0;
-       if ((timer = timeri->timer) != NULL) {
+       timer = timeri->timer;
+       if (timer) {
                if (timer->hw.c_resolution)
                        return timer->hw.c_resolution(timer);
                return timer->hw.resolution;