diff mbox

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

Message ID 4d1a6d05-6574-b1f4-80ee-59cb5238a74e@users.sourceforge.net (mailing list archive)
State New, archived
Headers show

Commit Message

SF Markus Elfring Aug. 23, 2017, 8:28 a.m. UTC
From: Markus Elfring <elfring@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@users.sourceforge.net>
---
 sound/core/timer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Takashi Iwai Aug. 23, 2017, 8:37 a.m. UTC | #1
On Wed, 23 Aug 2017 10:28:41 +0200,
SF Markus Elfring wrote:
> 
> From: Markus Elfring <elfring@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@users.sourceforge.net>

Applied, thanks.


Takashi
diff mbox

Patch

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;