[alsa-devel] [PATCH 5/6] ALSA: timer: Adjust a condition check in snd_timer_resolution()

SF Markus Elfring elfring at users.sourceforge.net
Wed Aug 23 10:28:41 CEST 2017


From: Markus Elfring <elfring at users.sourceforge.net>
Date: Wed, 23 Aug 2017 09:45:06 +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 at users.sourceforge.net>
---
 sound/core/timer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/core/timer.c b/sound/core/timer.c
index 6d73a63f6e2b..6cdd04a45962 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -395,5 +395,6 @@ unsigned long snd_timer_resolution(struct snd_timer_instance *timeri)
 		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;
-- 
2.14.0



More information about the Alsa-devel mailing list