[alsa-devel] Applied "ASoC: nau8825: drop redundant idiom when converting integer to boolean" to the asoc tree

Mark Brown broonie at kernel.org
Fri Jul 15 13:56:37 CEST 2016


The patch

   ASoC: nau8825: drop redundant idiom when converting integer to boolean

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 308e3e0bfa9ec9d1dc8c415e8a68ad4efd0fddfd Mon Sep 17 00:00:00 2001
From: John Hsu <KCHSU0 at nuvoton.com>
Date: Fri, 15 Jul 2016 10:06:17 +0800
Subject: [PATCH] ASoC: nau8825: drop redundant idiom when converting integer
 to boolean

Thanks Mark and Anatol for the discussion. According to the result,
the standard C will translate any non-zero value into true, or
false otherwise.
QUOTE:
"6.3.1.2 Boolean type
When any scalar value is converted to _Bool, the result is 0 if the
value compares equal to 0; otherwise, the result is 1
"
Thus, the "!!" idiom is removed.

Signed-off-by: John Hsu <KCHSU0 at nuvoton.com>
Signed-off-by: Mark Brown <broonie at kernel.org>
---
 sound/soc/codecs/nau8825.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index a97418deb034..5c9707ac4bbf 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -1349,9 +1349,9 @@ static bool nau8825_is_jack_inserted(struct regmap *regmap)
 	int status, jkdet;
 
 	regmap_read(regmap, NAU8825_REG_JACK_DET_CTRL, &jkdet);
-	active_high = !!(jkdet & NAU8825_JACK_POLARITY);
+	active_high = jkdet & NAU8825_JACK_POLARITY;
 	regmap_read(regmap, NAU8825_REG_I2C_DEVICE_ID, &status);
-	is_high = !!(status & NAU8825_GPIO2JD1);
+	is_high = status & NAU8825_GPIO2JD1;
 	/* return jack connection status according to jack insertion logic
 	 * active high or active low.
 	 */
-- 
2.8.1



More information about the Alsa-devel mailing list