diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-08-24 06:07:41 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-08-24 06:28:24 -0400 |
commit | 56026714bd45fccda710114982789c5145285560 (patch) | |
tree | aa2584557db01f8422ec2b238ca70a4bd221c7c8 | |
parent | b47b91c8504c62f95ddff2876620d68697927bd4 (diff) |
ASoC: codecs: msm8916-wcd-analog: always true condition
Static checkers complain that unsigned int val is always >= 0. The
context is that snd_soc_read() returns -1U on error. This is harmless
because we're checking that CDC_A_MBHC_RESULT_1_BTN_RESULT_MASK is not
set, and it will always be set for -1U. I could have just removed the
check against -1 but I preserved it because I thought it helped with
readability.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/msm8916-wcd-analog.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c index f834a639b350..cd4d60ef4c77 100644 --- a/sound/soc/codecs/msm8916-wcd-analog.c +++ b/sound/soc/codecs/msm8916-wcd-analog.c | |||
@@ -949,7 +949,7 @@ static irqreturn_t mbhc_btn_release_irq_handler(int irq, void *arg) | |||
949 | u32 val = snd_soc_read(codec, CDC_A_MBHC_RESULT_1); | 949 | u32 val = snd_soc_read(codec, CDC_A_MBHC_RESULT_1); |
950 | 950 | ||
951 | /* check if its BTN0 thats released */ | 951 | /* check if its BTN0 thats released */ |
952 | if ((val >= 0) && !(val & CDC_A_MBHC_RESULT_1_BTN_RESULT_MASK)) | 952 | if ((val != -1) && !(val & CDC_A_MBHC_RESULT_1_BTN_RESULT_MASK)) |
953 | priv->mbhc_btn0_pressed = false; | 953 | priv->mbhc_btn0_pressed = false; |
954 | 954 | ||
955 | } else { | 955 | } else { |