mmc: spacemit: fix the greater-than-or-equal-to-zero comparison
Subsystems (2)
PATCH 1/1 mmc: spacemit: fix the greater-than-or-equal-to-zero comparison
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.
--- drivers/mmc/spacemit_sdhci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/spacemit_sdhci.c +1 -2
@@ -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,
Signature · 1 line
Eric Chung <[email protected]>
Quoted 33 lines · Eric Chung
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_MINis declared as zero, it causes Coverity reporting the comparison issue.Now remove the redundant comparison.
Signed-off-by Eric Chung <[email protected]>--- drivers/mmc/spacemit_sdhci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/mmc/spacemit_sdhci.c +1
-3@@ -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
Quoted 4 lines
Best regards,
Signature · 1 line
Eric Chung <[email protected]>
This change does not make sense. We may adjust the preprocessor define at build time in the future.
-E