All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: tiwai@suse.de, broonie@kernel.org
Cc: alsa-devel@alsa-project.org,
	Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Subject: [PATCH 1/5] ALSA: soc-da7219: fix inappropriate condition statement
Date: Tue, 26 Jul 2016 22:41:53 +0900	[thread overview]
Message-ID: <1469540517-32466-2-git-send-email-o-takashi@sakamocchi.jp> (raw)
In-Reply-To: <1469540517-32466-1-git-send-email-o-takashi@sakamocchi.jp>

Sparse reports a below warning.

sound/soc/codecs/da7219.c:804:57: warning: dubious: x & !y

The line includes a condition statement; '(a < b) & !c'. Practically, the
evaluated value of this statement equals to the value of '(a < b) && !c'.
Although, it's not an usual way to use bitwise operations as logical
operations to several conditions.

This commit fixes the bug.

Fixes: 6d817c0e9fd7 ("ASoC: codecs: Add da7219 codec driver")
CC: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/soc/codecs/da7219.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
index 50ea943..b9fa8fe 100644
--- a/sound/soc/codecs/da7219.c
+++ b/sound/soc/codecs/da7219.c
@@ -801,7 +801,7 @@ static int da7219_dai_event(struct snd_soc_dapm_widget *w,
 				++i;
 				msleep(50);
 			}
-		} while ((i < DA7219_SRM_CHECK_RETRIES) & (!srm_lock));
+		} while ((i < DA7219_SRM_CHECK_RETRIES) && (!srm_lock));
 
 		if (!srm_lock)
 			dev_warn(codec->dev, "SRM failed to lock\n");
-- 
2.7.4

  reply	other threads:[~2016-07-26 13:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26 13:41 [PATCH 0/5] ALSA: soc: fix sparse warnings Takashi Sakamoto
2016-07-26 13:41 ` Takashi Sakamoto [this message]
2016-07-26 14:14   ` [PATCH 1/5] ALSA: soc-da7219: fix inappropriate condition statement Adam Thomson
2016-09-28 18:27   ` Applied "ASoC: da7219: fix inappropriate condition statement" to the asoc tree Mark Brown
2016-07-26 13:41 ` [PATCH 2/5] ALSA: soc-sst-bxt-rt298: fix obsoleted initializers for array Takashi Sakamoto
2016-07-27  3:14   ` Vinod Koul
2016-09-27 16:18   ` Applied "ASoC: sst-bxt-rt298: fix obsoleted initializers for array" to the asoc tree Mark Brown
2016-07-26 13:41 ` [PATCH 3/5] ALSA: soc-sst-bxt-da7219_max98357a: fix obsoleted initializers for array Takashi Sakamoto
2016-07-27  3:15   ` Vinod Koul
2016-07-27  3:38     ` Takashi Sakamoto
2016-07-27  6:00       ` Vinod Koul
2016-07-26 13:41 ` [PATCH 4/5] ALSA: soc-rt5616: add static qualifier for file local symbols Takashi Sakamoto
2016-09-27 16:18   ` Applied "ASoC: rt5616: add static qualifier for file local symbols" to the asoc tree Mark Brown
2016-07-26 13:41 ` [PATCH 5/5] ALSA: soc-tpa6130a2: add static qualifier for file local symbols Takashi Sakamoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469540517-32466-2-git-send-email-o-takashi@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=Adam.Thomson.Opensource@diasemi.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.