mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
To: Ludovic Barre <ludovic.Barre@st.com>,
	Marek Vasut <marek.vasut@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	Richard Weinberger <richard@nod.at>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH v2 1/3] mtd: spi-nor: stm32-quadspi: Fix uninitialized error return code
Date: Sun, 29 Oct 2017 18:50:46 +0100	[thread overview]
Message-ID: <ed1ca205-830e-3f5b-e251-8d863a512eda@wedev4u.fr> (raw)
In-Reply-To: <1509030755-19044-2-git-send-email-ludovic.Barre@st.com>

Hi Ludovic,

Le 26/10/2017 à 17:12, Ludovic Barre a écrit :
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> 
> With gcc 4.1.2:
> 
>     drivers/mtd/spi-nor/stm32-quadspi.c: In function ‘stm32_qspi_tx_poll’:
>     drivers/mtd/spi-nor/stm32-quadspi.c:230: warning: ‘ret’ may be used uninitialized in this function
> 
> Indeed, if stm32_qspi_cmd.len is zero, ret will be uninitialized.
> This length is passed from outside the driver using the
> spi_nor.{read,write}{,_reg}() callbacks.
> 
> Several functions in drivers/mtd/spi-nor/spi-nor.c (e.g. write_enable(),
> write_disable(), and erase_chip()) call spi_nor.write_reg() with a zero
> length.
> 
> Fix this by returning an explicit zero on success.
> 
> Fixes: 0d43d7ab277a048c ("mtd: spi-nor: add driver for STM32 quad spi flash controller")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Acked-by: Ludovic Barre <ludovic.barre@st.com>
> Signed-off-by: Ludovic Barre <ludovic.barre@st.com>
I removed your "Signed-off" because I think this is a mistake but kept
your "Acked-by" tag.

Applied to the spi-nor/next branch of l2-mtd.

Thanks!

> ---
>  drivers/mtd/spi-nor/stm32-quadspi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/spi-nor/stm32-quadspi.c b/drivers/mtd/spi-nor/stm32-quadspi.c
> index 86c0931..ad6a3e1 100644
> --- a/drivers/mtd/spi-nor/stm32-quadspi.c
> +++ b/drivers/mtd/spi-nor/stm32-quadspi.c
> @@ -240,12 +240,12 @@ static int stm32_qspi_tx_poll(struct stm32_qspi *qspi,
>  						 STM32_QSPI_FIFO_TIMEOUT_US);
>  		if (ret) {
>  			dev_err(qspi->dev, "fifo timeout (stat:%#x)\n", sr);
> -			break;
> +			return ret;
>  		}
>  		tx_fifo(buf++, qspi->io_base + QUADSPI_DR);
>  	}
>  
> -	return ret;
> +	return 0;
>  }
>  
>  static int stm32_qspi_tx_mm(struct stm32_qspi *qspi,
> 

  reply	other threads:[~2017-10-29 17:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26 15:12 [PATCH v2 0/3] mtd: spi-nor: stm32-quadspi: fixes Ludovic Barre
2017-10-26 15:12 ` [PATCH v2 1/3] mtd: spi-nor: stm32-quadspi: Fix uninitialized error return code Ludovic Barre
2017-10-29 17:50   ` Cyrille Pitchen [this message]
2017-10-30  8:05     ` Ludovic BARRE
2017-10-26 15:12 ` [PATCH v2 2/3] mtd: spi-nor: stm32-quadspi: fix prefetching outside fsize Ludovic Barre
2017-10-29 17:57   ` Cyrille Pitchen
2017-10-26 15:12 ` [PATCH v2 3/3] mtd: spi-nor: stm32-quadspi: change license text Ludovic Barre
2017-10-29 17:51   ` Cyrille Pitchen

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=ed1ca205-830e-3f5b-e251-8d863a512eda@wedev4u.fr \
    --to=cyrille.pitchen@wedev4u.fr \
    --cc=alexandre.torgue@st.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=ludovic.Barre@st.com \
    --cc=marek.vasut@gmail.com \
    --cc=richard@nod.at \
    --cc=robh+dt@kernel.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

all inboxes | Powered by JetHome®