* [PATCH] mci: sunxi-mmc: do not log error message on EINVAL error
@ 2025-03-14 22:44 Jules Maselbas
0 siblings, 0 replies; only message in thread
From: Jules Maselbas @ 2025-03-14 22:44 UTC (permalink / raw)
To: barebox; +Cc: Jules Maselbas
In the function sdxc_send_cmd: logging the error could use the
uninitialized variable `why`, this can be the case when the
sunxi_mmc_send_cmd function returns very early with the -EINVAL
error code. This doesnt needs to be logged.
Also add a default value for the variable.
Signed-off-by: Jules Maselbas <jmaselbas@zdiv.net>
---
drivers/mci/sunxi-mmc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mci/sunxi-mmc.c b/drivers/mci/sunxi-mmc.c
index a19abbe55d..376ef2c0a9 100644
--- a/drivers/mci/sunxi-mmc.c
+++ b/drivers/mci/sunxi-mmc.c
@@ -24,11 +24,11 @@ static int sdxc_send_cmd(struct mci_host *mci, struct mci_cmd *cmd, struct mci_d
{
struct sunxi_mmc_host *host = to_sunxi_mmc_host(mci);
struct device *dev = mci->hw_dev;
- const char *why;
+ const char *why = "";
int ret;
ret = sunxi_mmc_send_cmd(host, cmd, data, &why);
- if (ret && ret != -ETIMEDOUT)
+ if (ret && ret != -ETIMEDOUT && ret != -EINVAL)
dev_err(dev, "error %s CMD%d (%d)\n", why, cmd->cmdidx, ret);
if (ret == -ETIMEDOUT)
mdelay(1);
--
2.48.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-03-14 22:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-14 22:44 [PATCH] mci: sunxi-mmc: do not log error message on EINVAL error Jules Maselbas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox