From: Jiapeng Chong Date: Mon, 6 Feb 2023 07:55:18 +0000 (+0800) Subject: ASoC: codecs: Fix unsigned comparison with less than zero X-Git-Tag: v6.6.7~3340^2~4^2~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05f5504b161054bdce74eef5d9ff602bbebaeca8;p=platform%2Fkernel%2Flinux-starfive.git ASoC: codecs: Fix unsigned comparison with less than zero The val is defined as unsigned int type, if(val<0) is redundant, so delete it. sound/soc/codecs/idt821034.c:449 idt821034_kctrl_gain_put() warn: unsigned 'val' is never less than zero. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3947 Signed-off-by: Jiapeng Chong Acked-by: Herve Codina Link: https://lore.kernel.org/r/20230206075518.84169-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/idt821034.c b/sound/soc/codecs/idt821034.c index 5d01787..2cc7b91 100644 --- a/sound/soc/codecs/idt821034.c +++ b/sound/soc/codecs/idt821034.c @@ -446,8 +446,6 @@ static int idt821034_kctrl_gain_put(struct snd_kcontrol *kcontrol, u8 ch; val = ucontrol->value.integer.value[0]; - if (val < 0) - return -EINVAL; if (val > max - min) return -EINVAL;