From: Advait Dhamorikar <advaitdhamorikar@gmail.com>
To: Shenghao Ding <shenghao-ding@ti.com>, Kevin Lu <kevin-lu@ti.com>,
Baojun Xu <baojun.xu@ti.com>, Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.orgs, skhan@linuxfoundation.org,
anupnewsmail@gmail.com,
Advait Dhamorikar <advaitdhamorikar@gmail.com>
Subject: [PATCH] Fix unsigned int compared against 0
Date: Fri, 4 Oct 2024 19:40:46 +0530 [thread overview]
Message-ID: <20241004141046.61265-1-advaitdhamorikar@gmail.com> (raw)
An unsigned value held by offset can never be
negative, so this test will always evaluate
the same way and is therefore redundant.
Signed-off-by: Advait Dhamorikar <advaitdhamorikar@gmail.com>
---
sound/soc/codecs/tlv320adc3xxx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/tlv320adc3xxx.c b/sound/soc/codecs/tlv320adc3xxx.c
index 7073b9d1cda8..868e8a91e05b 100644
--- a/sound/soc/codecs/tlv320adc3xxx.c
+++ b/sound/soc/codecs/tlv320adc3xxx.c
@@ -961,7 +961,7 @@ static int adc3xxx_gpio_request(struct gpio_chip *chip, unsigned int offset)
if (offset >= ADC3XXX_GPIOS_MAX)
return -EINVAL;
- if (offset >= 0 && offset < ADC3XXX_GPIO_PINS) {
+ if (offset < ADC3XXX_GPIO_PINS) {
/* GPIO1 is offset 0, GPIO2 is offset 1 */
/* We check here that the GPIO pins are either not configured
* in the DT, or that they purposely are set as outputs.
--
2.34.1
next reply other threads:[~2024-10-04 14:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 14:10 Advait Dhamorikar [this message]
2024-10-04 14:50 ` [PATCH] Fix unsigned int compared against 0 Mark Brown
2024-10-05 3:51 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241004141046.61265-1-advaitdhamorikar@gmail.com \
--to=advaitdhamorikar@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=anupnewsmail@gmail.com \
--cc=baojun.xu@ti.com \
--cc=broonie@kernel.org \
--cc=kevin-lu@ti.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.orgs \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=shenghao-ding@ti.com \
--cc=skhan@linuxfoundation.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox