mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jules Maselbas <jmaselbas@zdiv.net>
To: barebox@lists.infradead.org
Cc: Jules Maselbas <jmaselbas@zdiv.net>
Subject: [PATCH] mci: sunxi-mmc: do not log error message on EINVAL error
Date: Fri, 14 Mar 2025 23:44:39 +0100	[thread overview]
Message-ID: <20250314224439.30069-1-jmaselbas@zdiv.net> (raw)

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




                 reply	other threads:[~2025-03-14 22:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20250314224439.30069-1-jmaselbas@zdiv.net \
    --to=jmaselbas@zdiv.net \
    --cc=barebox@lists.infradead.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