All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Pihet <jean.pihet@newoldbits.com>
To: Mark Brown <broonie@kernel.org>
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
	linux-omap@vger.kernel.org, linux-spi@vger.kernel.org,
	Ryan Barnett <ryan.barnett@rockwellcollins.com>,
	Conrad Ratschan <conrad.ratschan@rockwellcollins.com>,
	Arnout Vandecappelle <arnout.vandecappelle@essensium.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Jean Pihet <jean.pihet@newoldbits.com>
Subject: [PATCH] spi: spi-ti-qspi: fix warning
Date: Wed, 15 Jan 2020 11:07:00 +0100	[thread overview]
Message-ID: <20200115100700.3357-1-jean.pihet@newoldbits.com> (raw)

drivers/spi/spi-ti-qspi.c: In function ‘ti_qspi_start_transfer_one’:
drivers/spi/spi-ti-qspi.c:392:8: warning: ‘rx_wlen’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  392 |     if (rx_wlen >= 32)
      |        ^
drivers/spi/spi-ti-qspi.c:318:12: note: ‘rx_wlen’ was declared here
  318 |  u8 rxlen, rx_wlen;
      |            ^~~~~~~

The warning is a false positive; it is not thrown by all compiler versions, e.g.
Red Hat Cross 9.2.1-1 but not Linaro GCC 7.5-2019.12.

Signed-off-by: Jean Pihet <jean.pihet@newoldbits.com>
---
 drivers/spi/spi-ti-qspi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c
index 858fda8ac73e..366a3e5cca6b 100644
--- a/drivers/spi/spi-ti-qspi.c
+++ b/drivers/spi/spi-ti-qspi.c
@@ -332,6 +332,7 @@ static int qspi_read_msg(struct ti_qspi *qspi, struct spi_transfer *t,
 		break;
 	}
 	wlen = t->bits_per_word >> 3;	/* in bytes */
+	rx_wlen = wlen;
 
 	while (count) {
 		dev_dbg(qspi->dev, "rx cmd %08x dc %08x\n", cmd, qspi->dc);
-- 
2.24.1

             reply	other threads:[~2020-01-15 10:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 10:07 Jean Pihet [this message]
2020-01-17 15:44 ` Applied "spi: spi-ti-qspi: fix warning" to the spi tree Mark Brown

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=20200115100700.3357-1-jean.pihet@newoldbits.com \
    --to=jean.pihet@newoldbits.com \
    --cc=arnout.vandecappelle@essensium.com \
    --cc=broonie@kernel.org \
    --cc=conrad.ratschan@rockwellcollins.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=ryan.barnett@rockwellcollins.com \
    --cc=sfr@canb.auug.org.au \
    --cc=vigneshr@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.