summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorJohn Hsu <KCHSU0@nuvoton.com>2016-07-15 02:06:17 (GMT)
committerMark Brown <broonie@kernel.org>2016-07-15 10:46:43 (GMT)
commit308e3e0bfa9ec9d1dc8c415e8a68ad4efd0fddfd (patch)
treea129f2d0043a57659e14a9fcff7f1d6ad56272b8 /sound
parentbff03e81502cb9ac99daeeb47b4d0e779cc48fde (diff)
downloadlinux-308e3e0bfa9ec9d1dc8c415e8a68ad4efd0fddfd.tar.xz
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@nuvoton.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/nau8825.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index a97418d..5c9707a 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.
*/