linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: marvell: prevent harmless warnings
@ 2018-09-07 14:29 Miquel Raynal
  2018-09-10 12:57 ` Boris Brezillon
  0 siblings, 1 reply; 4+ messages in thread
From: Miquel Raynal @ 2018-09-07 14:29 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger, David Woodhouse,
	Brian Norris, Marek Vasut
  Cc: linux-mtd, Miquel Raynal, stable

Since the addition of WARN_ON() in nand_subop_get_data/addr_len()
helpers, this driver will produce harmless warnings (mostly at probe)
just because it always called the *_data_len() helper in the parsing
function (even on non-data instructions, where this value is
meaningless and unneeded.

Fix these warnings by deriving the length only when it is relevant.

Fixes: 760c435e0f85 ("mtd: rawnand: make subop helpers return unsigned values")
Cc: stable@vger.kernel.org
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/marvell_nand.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
index 7af4d6213ee5..bc2ef5209783 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -1547,7 +1547,7 @@ static void marvell_nfc_parse_instructions(struct nand_chip *chip,
 	for (op_id = 0; op_id < subop->ninstrs; op_id++) {
 		unsigned int offset, naddrs;
 		const u8 *addrs;
-		int len = nand_subop_get_data_len(subop, op_id);
+		int len;
 
 		instr = &subop->instrs[op_id];
 
@@ -1593,6 +1593,7 @@ static void marvell_nfc_parse_instructions(struct nand_chip *chip,
 				nfc_op->ndcb[0] |=
 					NDCB0_CMD_XTYPE(XTYPE_MONOLITHIC_RW) |
 					NDCB0_LEN_OVRD;
+				len = nand_subop_get_data_len(subop, op_id);
 				nfc_op->ndcb[3] |= round_up(len, FIFO_DEPTH);
 			}
 			nfc_op->data_delay_ns = instr->delay_ns;
@@ -1606,6 +1607,7 @@ static void marvell_nfc_parse_instructions(struct nand_chip *chip,
 				nfc_op->ndcb[0] |=
 					NDCB0_CMD_XTYPE(XTYPE_MONOLITHIC_RW) |
 					NDCB0_LEN_OVRD;
+				len = nand_subop_get_data_len(subop, op_id);
 				nfc_op->ndcb[3] |= round_up(len, FIFO_DEPTH);
 			}
 			nfc_op->data_delay_ns = instr->delay_ns;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: rawnand: marvell: prevent harmless warnings
  2018-09-07 14:29 [PATCH] mtd: rawnand: marvell: prevent harmless warnings Miquel Raynal
@ 2018-09-10 12:57 ` Boris Brezillon
  2018-09-10 13:15   ` Miquel Raynal
  0 siblings, 1 reply; 4+ messages in thread
From: Boris Brezillon @ 2018-09-10 12:57 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, David Woodhouse, Brian Norris, Marek Vasut,
	linux-mtd, stable

On Fri,  7 Sep 2018 16:29:54 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Since the addition of WARN_ON() in nand_subop_get_data/addr_len()
> helpers, this driver will produce harmless warnings (mostly at probe)
> just because it always called the *_data_len() helper in the parsing

			 ^calls

> function (even on non-data instructions, where this value is
> meaningless and unneeded.

			  ^ missing ')'

> 
> Fix these warnings by deriving the length only when it is relevant.
> 
> Fixes: 760c435e0f85 ("mtd: rawnand: make subop helpers return unsigned values")
> Cc: stable@vger.kernel.org

You can drop the above line this 760c435e0f85 was merged in 4.19-rc1.

If you're okay with these changes, no need to send a new version, I'll
fix it when applying.

Thanks,

Boris

> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  drivers/mtd/nand/raw/marvell_nand.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> index 7af4d6213ee5..bc2ef5209783 100644
> --- a/drivers/mtd/nand/raw/marvell_nand.c
> +++ b/drivers/mtd/nand/raw/marvell_nand.c
> @@ -1547,7 +1547,7 @@ static void marvell_nfc_parse_instructions(struct nand_chip *chip,
>  	for (op_id = 0; op_id < subop->ninstrs; op_id++) {
>  		unsigned int offset, naddrs;
>  		const u8 *addrs;
> -		int len = nand_subop_get_data_len(subop, op_id);
> +		int len;
>  
>  		instr = &subop->instrs[op_id];
>  
> @@ -1593,6 +1593,7 @@ static void marvell_nfc_parse_instructions(struct nand_chip *chip,
>  				nfc_op->ndcb[0] |=
>  					NDCB0_CMD_XTYPE(XTYPE_MONOLITHIC_RW) |
>  					NDCB0_LEN_OVRD;
> +				len = nand_subop_get_data_len(subop, op_id);
>  				nfc_op->ndcb[3] |= round_up(len, FIFO_DEPTH);
>  			}
>  			nfc_op->data_delay_ns = instr->delay_ns;
> @@ -1606,6 +1607,7 @@ static void marvell_nfc_parse_instructions(struct nand_chip *chip,
>  				nfc_op->ndcb[0] |=
>  					NDCB0_CMD_XTYPE(XTYPE_MONOLITHIC_RW) |
>  					NDCB0_LEN_OVRD;
> +				len = nand_subop_get_data_len(subop, op_id);
>  				nfc_op->ndcb[3] |= round_up(len, FIFO_DEPTH);
>  			}
>  			nfc_op->data_delay_ns = instr->delay_ns;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: rawnand: marvell: prevent harmless warnings
  2018-09-10 12:57 ` Boris Brezillon
@ 2018-09-10 13:15   ` Miquel Raynal
  2018-09-17 12:32     ` Boris Brezillon
  0 siblings, 1 reply; 4+ messages in thread
From: Miquel Raynal @ 2018-09-10 13:15 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Richard Weinberger, David Woodhouse, Brian Norris, Marek Vasut,
	linux-mtd, stable

Hi Boris,

Boris Brezillon <boris.brezillon@bootlin.com> wrote on Mon, 10 Sep 2018
14:57:44 +0200:

> On Fri,  7 Sep 2018 16:29:54 +0200
> Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> 
> > Since the addition of WARN_ON() in nand_subop_get_data/addr_len()
> > helpers, this driver will produce harmless warnings (mostly at probe)
> > just because it always called the *_data_len() helper in the parsing  
> 
> 			 ^calls
> 
> > function (even on non-data instructions, where this value is
> > meaningless and unneeded.  
> 
> 			  ^ missing ')'
> 
> > 
> > Fix these warnings by deriving the length only when it is relevant.
> > 
> > Fixes: 760c435e0f85 ("mtd: rawnand: make subop helpers return unsigned values")
> > Cc: stable@vger.kernel.org  
> 
> You can drop the above line this 760c435e0f85 was merged in 4.19-rc1.
> 
> If you're okay with these changes, no need to send a new version, I'll
> fix it when applying.

Sure, you can apply, thanks for fixing it.

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: rawnand: marvell: prevent harmless warnings
  2018-09-10 13:15   ` Miquel Raynal
@ 2018-09-17 12:32     ` Boris Brezillon
  0 siblings, 0 replies; 4+ messages in thread
From: Boris Brezillon @ 2018-09-17 12:32 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, stable, Marek Vasut, linux-mtd, Brian Norris,
	David Woodhouse

On Mon, 10 Sep 2018 15:15:23 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Hi Boris,
> 
> Boris Brezillon <boris.brezillon@bootlin.com> wrote on Mon, 10 Sep 2018
> 14:57:44 +0200:
> 
> > On Fri,  7 Sep 2018 16:29:54 +0200
> > Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >   
> > > Since the addition of WARN_ON() in nand_subop_get_data/addr_len()
> > > helpers, this driver will produce harmless warnings (mostly at probe)
> > > just because it always called the *_data_len() helper in the parsing    
> > 
> > 			 ^calls
> >   
> > > function (even on non-data instructions, where this value is
> > > meaningless and unneeded.    
> > 
> > 			  ^ missing ')'
> >   
> > > 
> > > Fix these warnings by deriving the length only when it is relevant.
> > > 
> > > Fixes: 760c435e0f85 ("mtd: rawnand: make subop helpers return unsigned values")
> > > Cc: stable@vger.kernel.org    
> > 
> > You can drop the above line this 760c435e0f85 was merged in 4.19-rc1.
> > 
> > If you're okay with these changes, no need to send a new version, I'll
> > fix it when applying.  
> 
> Sure, you can apply, thanks for fixing it.

Queued to master.

Thanks,

Boris

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-17 12:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-07 14:29 [PATCH] mtd: rawnand: marvell: prevent harmless warnings Miquel Raynal
2018-09-10 12:57 ` Boris Brezillon
2018-09-10 13:15   ` Miquel Raynal
2018-09-17 12:32     ` Boris Brezillon

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).