public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: marvell: Fix missing memory allocation modifier
@ 2018-01-19 17:39 Miquel Raynal
  2018-01-20 13:56 ` Boris Brezillon
  0 siblings, 1 reply; 2+ messages in thread
From: Miquel Raynal @ 2018-01-19 17:39 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger, David Woodhouse,
	Brian Norris, Marek Vasut, Cyrille Pitchen
  Cc: linux-mtd, Miquel Raynal

The function marvell_nfc_init_dma() allocates a DMA buffer without the
GFP_KERNEL modifier, that triggers this warning:
"marvell_nfc_init_dma() error: no modifiers for allocation."

Fix this by using (GFP_KERNEL | GFP_DMA) instead of only GFP_DMA as the
probe happens in non-interrupt context.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
---
 drivers/mtd/nand/marvell_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/marvell_nand.c b/drivers/mtd/nand/marvell_nand.c
index 48d78ca0d71c..5f49c4e0e9e1 100644
--- a/drivers/mtd/nand/marvell_nand.c
+++ b/drivers/mtd/nand/marvell_nand.c
@@ -2670,7 +2670,7 @@ static int marvell_nfc_init_dma(struct marvell_nfc *nfc)
 	 * for DMA transfers and then copy the desired amount of data to
 	 * the provided buffer.
 	 */
-	nfc->dma_buf = kmalloc(MAX_CHUNK_SIZE, GFP_DMA);
+	nfc->dma_buf = kmalloc(MAX_CHUNK_SIZE, GFP_KERNEL | GFP_DMA);
 	if (!nfc->dma_buf)
 		return -ENOMEM;
 
-- 
2.11.0

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

* Re: [PATCH] mtd: nand: marvell: Fix missing memory allocation modifier
  2018-01-19 17:39 [PATCH] mtd: nand: marvell: Fix missing memory allocation modifier Miquel Raynal
@ 2018-01-20 13:56 ` Boris Brezillon
  0 siblings, 0 replies; 2+ messages in thread
From: Boris Brezillon @ 2018-01-20 13:56 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, David Woodhouse, Brian Norris, Marek Vasut,
	Cyrille Pitchen, linux-mtd

On Fri, 19 Jan 2018 18:39:01 +0100
Miquel Raynal <miquel.raynal@free-electrons.com> wrote:

> The function marvell_nfc_init_dma() allocates a DMA buffer without the
> GFP_KERNEL modifier, that triggers this warning:
> "marvell_nfc_init_dma() error: no modifiers for allocation."
> 
> Fix this by using (GFP_KERNEL | GFP_DMA) instead of only GFP_DMA as the
> probe happens in non-interrupt context.

Applied.

Thanks,

Boris

> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
> ---
>  drivers/mtd/nand/marvell_nand.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/marvell_nand.c b/drivers/mtd/nand/marvell_nand.c
> index 48d78ca0d71c..5f49c4e0e9e1 100644
> --- a/drivers/mtd/nand/marvell_nand.c
> +++ b/drivers/mtd/nand/marvell_nand.c
> @@ -2670,7 +2670,7 @@ static int marvell_nfc_init_dma(struct marvell_nfc *nfc)
>  	 * for DMA transfers and then copy the desired amount of data to
>  	 * the provided buffer.
>  	 */
> -	nfc->dma_buf = kmalloc(MAX_CHUNK_SIZE, GFP_DMA);
> +	nfc->dma_buf = kmalloc(MAX_CHUNK_SIZE, GFP_KERNEL | GFP_DMA);
>  	if (!nfc->dma_buf)
>  		return -ENOMEM;
>  

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

end of thread, other threads:[~2018-01-20 13:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-19 17:39 [PATCH] mtd: nand: marvell: Fix missing memory allocation modifier Miquel Raynal
2018-01-20 13:56 ` Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox