archive mirror
 help / color / mirror / Atom feed
From: Rui Miguel Silva <>
To: Greg Kroah-Hartman <>,
	Alan Stern <>
Cc:, Rui Miguel Silva <>
Subject: [PATCH 1/5] usb: isp1760: ignore return value for bus change pattern
Date: Thu, 19 Aug 2021 19:09:25 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

We do not care about the return value of that read between the
scratch register write and read, we really just want to make sure that
the pattern in the bus get changed to make sure we are testing
correctly the scratch pattern.

Clang-analyzer complains about the never read scratch variable:
>> drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
    scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);

Just ignore the return value of that CHIP_ID_HIGH read, add more
information to the comment above why we are doing this. And as at it,
just do a small format change in the error message bellow.

Signed-off-by: Rui Miguel Silva <>
 drivers/usb/isp1760/isp1760-hcd.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
index 825be736be33..2a21fe5aa7a8 100644
--- a/drivers/usb/isp1760/isp1760-hcd.c
+++ b/drivers/usb/isp1760/isp1760-hcd.c
@@ -731,11 +731,15 @@ static int isp1760_hc_setup(struct usb_hcd *hcd)
 	isp1760_hcd_write(hcd, HC_SCRATCH, pattern);
-	/* Change bus pattern */
-	scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
+	/*
+	 * we do not care about the read value here we just want to
+	 * change bus pattern.
+	 */
+	isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
 	scratch = isp1760_hcd_read(hcd, HC_SCRATCH);
 	if (scratch != pattern) {
-		dev_err(hcd->self.controller, "Scratch test failed. 0x%08x\n", scratch);
+		dev_err(hcd->self.controller, "Scratch test failed. 0x%08x\n",
+			scratch);
 		return -ENODEV;

  reply	other threads:[~2021-08-19 18:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 18:09 [PATCH 0/5] usb: isp1760: clang analyzer fixes Rui Miguel Silva
2021-08-19 18:09 ` Rui Miguel Silva [this message]
2021-08-19 18:09 ` [PATCH 2/5] usb: isp1760: check maxpacketsize before using it Rui Miguel Silva
2021-08-19 18:09 ` [PATCH 3/5] usb: isp1760: do not reset retval Rui Miguel Silva
2021-08-19 18:09 ` [PATCH 4/5] usb: isp1760: do not shift in uninitialized slot Rui Miguel Silva
2021-08-19 18:09 ` [PATCH 5/5] usb: isp1760: clean never read udc_enabled warning Rui Miguel Silva

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).