From: E Shattow <e@freeshell.de>
To: Eric Chung <eric.chung@riscstar.com>,
Tanmay Kathpalia <tanmay.kathpalia@altera.com>,
u-boot-spacemit@groups.io, u-boot@lists.u-boot-project.org
Cc: Huan Zhou <pericycle.cc@gmail.com>, Yixun Lan <dlan@kernel.org>,
Peng Fan <peng.fan@nxp.com>,
Jaehoon Chung <jh80.chung@samsung.com>,
Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH] mmc: spacemit: fix the greater-than-or-equal-to-zero comparison
Date: Wed, 4 Nov 2026 17:44:59 -0800 [thread overview]
Message-ID: <7115e35e-c5f2-45ba-95dc-759bc7e33daa@freeshell.de> (raw)
In-Reply-To: <20261105-fix_cid-v1-1-e44bc1da8900@riscstar.com>
On 11/4/26 17:27, Eric Chung wrote:
> CID 661178: Control flow issues (NO_EFFECT)
> This greater-than-or-equal-to-zero comparison of an unsigned value
> is always true. "retry_delays[i] >= 0".
>
> Since SPACEMIT_RX_TUNE_DELAY_MIN is declared as zero, it causes
> Coverity reporting the comparison issue.
>
> Now remove the redundant comparison.
>
> Signed-off-by: Eric Chung <eric.chung@riscstar.com>
> ---
> drivers/mmc/spacemit_sdhci.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/spacemit_sdhci.c b/drivers/mmc/spacemit_sdhci.c
> index f5578f38bdd1..3e0e7901b59d 100644
> --- a/drivers/mmc/spacemit_sdhci.c
> +++ b/drivers/mmc/spacemit_sdhci.c
> @@ -473,8 +473,7 @@ static int spacemit_sdhci_execute_tuning(struct mmc *mmc, u8 opcode)
> final_delay);
>
> for (i = 0; i < retry_count; i++) {
> - if (retry_delays[i] >= SPACEMIT_RX_TUNE_DELAY_MIN &&
> - retry_delays[i] <= SPACEMIT_RX_TUNE_DELAY_MAX) {
> + if (retry_delays[i] <= SPACEMIT_RX_TUNE_DELAY_MAX) {
> spacemit_sdhci_set_rx_delay(host, retry_delays[i]);
> ret = mmc_send_tuning(host->mmc, opcode);
> if (!ret) {
>
> ---
> base-commit: d1d45c926a571fb6c1e6d7105c280833646915ea
> change-id: 20261105-fix_cid-fe26c76c2c51
>
> Best regards,
> --
> Eric Chung <eric.chung@riscstar.com>
>
This change does not make sense. We may adjust the preprocessor define
at build time in the future.
-E
prev parent reply other threads:[~2026-11-05 1:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 1:27 [PATCH] mmc: spacemit: fix the greater-than-or-equal-to-zero comparison Eric Chung
2026-11-05 1:44 ` E Shattow [this message]
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=7115e35e-c5f2-45ba-95dc-759bc7e33daa@freeshell.de \
--to=e@freeshell.de \
--cc=dlan@kernel.org \
--cc=eric.chung@riscstar.com \
--cc=jh80.chung@samsung.com \
--cc=peng.fan@nxp.com \
--cc=pericycle.cc@gmail.com \
--cc=tanmay.kathpalia@altera.com \
--cc=trini@konsulko.com \
--cc=u-boot-spacemit@groups.io \
--cc=u-boot@lists.u-boot-project.org \
/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