Skip to content

Commit 308e3e0

Browse files
John-Hsubroonie
authored andcommitted
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent bff03e8 commit 308e3e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/soc/codecs/nau8825.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,9 +1349,9 @@ static bool nau8825_is_jack_inserted(struct regmap *regmap)
13491349
int status, jkdet;
13501350

13511351
regmap_read(regmap, NAU8825_REG_JACK_DET_CTRL, &jkdet);
1352-
active_high = !!(jkdet & NAU8825_JACK_POLARITY);
1352+
active_high = jkdet & NAU8825_JACK_POLARITY;
13531353
regmap_read(regmap, NAU8825_REG_I2C_DEVICE_ID, &status);
1354-
is_high = !!(status & NAU8825_GPIO2JD1);
1354+
is_high = status & NAU8825_GPIO2JD1;
13551355
/* return jack connection status according to jack insertion logic
13561356
* active high or active low.
13571357
*/

0 commit comments

Comments
 (0)