* [PATCH] nand: denali: remove undefined GFP_DMA flag
@ 2018-11-14 15:14 Enrico Jorns
2018-11-14 22:55 ` Andrey Smirnov
2018-11-19 8:08 ` Sascha Hauer
0 siblings, 2 replies; 4+ messages in thread
From: Enrico Jorns @ 2018-11-14 15:14 UTC (permalink / raw)
To: barebox; +Cc: Enrico Jorns
This was a remnant from porting kernel code to barebox.
While being uncritical so far, this will now cause a compiler error
since kzalloc is not a define but a static inline function.
As the kzalloc() 'mode' argument was ignored before and still will be,
it is safe to remove the parameter.
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
---
drivers/mtd/nand/nand_denali.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/nand_denali.c b/drivers/mtd/nand/nand_denali.c
index 8b09b3722f..ef3395864c 100644
--- a/drivers/mtd/nand/nand_denali.c
+++ b/drivers/mtd/nand/nand_denali.c
@@ -1387,7 +1387,7 @@ int denali_init(struct denali_nand_info *denali)
}
/* allocate a temporary buffer for nand_scan_ident() */
- denali->buf.buf = kzalloc(PAGE_SIZE, GFP_DMA | GFP_KERNEL);
+ denali->buf.buf = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!denali->buf.buf)
return -ENOMEM;
--
2.19.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nand: denali: remove undefined GFP_DMA flag
2018-11-14 15:14 [PATCH] nand: denali: remove undefined GFP_DMA flag Enrico Jorns
@ 2018-11-14 22:55 ` Andrey Smirnov
2018-11-16 9:43 ` Enrico Joerns
2018-11-19 8:08 ` Sascha Hauer
1 sibling, 1 reply; 4+ messages in thread
From: Andrey Smirnov @ 2018-11-14 22:55 UTC (permalink / raw)
To: ejo; +Cc: Barebox List
On Wed, Nov 14, 2018 at 7:15 AM Enrico Jorns <ejo@pengutronix.de> wrote:
>
> This was a remnant from porting kernel code to barebox.
> While being uncritical so far, this will now cause a compiler error
> since kzalloc is not a define but a static inline function.
>
> As the kzalloc() 'mode' argument was ignored before and still will be,
> it is safe to remove the parameter.
>
> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
> ---
> drivers/mtd/nand/nand_denali.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/nand_denali.c b/drivers/mtd/nand/nand_denali.c
> index 8b09b3722f..ef3395864c 100644
> --- a/drivers/mtd/nand/nand_denali.c
> +++ b/drivers/mtd/nand/nand_denali.c
> @@ -1387,7 +1387,7 @@ int denali_init(struct denali_nand_info *denali)
> }
>
> /* allocate a temporary buffer for nand_scan_ident() */
> - denali->buf.buf = kzalloc(PAGE_SIZE, GFP_DMA | GFP_KERNEL);
> + denali->buf.buf = kzalloc(PAGE_SIZE, GFP_KERNEL);
> if (!denali->buf.buf)
> return -ENOMEM;
Just as a suggestion, maybe just replace this call with xzalloc,
getting rid of meaningless GFP_KERNEL as well, and dropping the OOM
check below?
Thanks,
Andrey Smirnov
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nand: denali: remove undefined GFP_DMA flag
2018-11-14 22:55 ` Andrey Smirnov
@ 2018-11-16 9:43 ` Enrico Joerns
0 siblings, 0 replies; 4+ messages in thread
From: Enrico Joerns @ 2018-11-16 9:43 UTC (permalink / raw)
To: Andrey Smirnov; +Cc: Barebox List
On 11/14/18 11:55 PM, Andrey Smirnov wrote:
> On Wed, Nov 14, 2018 at 7:15 AM Enrico Jorns <ejo@pengutronix.de> wrote:
>>
>> This was a remnant from porting kernel code to barebox.
>> While being uncritical so far, this will now cause a compiler error
>> since kzalloc is not a define but a static inline function.
>>
>> As the kzalloc() 'mode' argument was ignored before and still will be,
>> it is safe to remove the parameter.
>>
>> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
>> ---
>> drivers/mtd/nand/nand_denali.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/nand/nand_denali.c b/drivers/mtd/nand/nand_denali.c
>> index 8b09b3722f..ef3395864c 100644
>> --- a/drivers/mtd/nand/nand_denali.c
>> +++ b/drivers/mtd/nand/nand_denali.c
>> @@ -1387,7 +1387,7 @@ int denali_init(struct denali_nand_info *denali)
>> }
>>
>> /* allocate a temporary buffer for nand_scan_ident() */
>> - denali->buf.buf = kzalloc(PAGE_SIZE, GFP_DMA | GFP_KERNEL);
>> + denali->buf.buf = kzalloc(PAGE_SIZE, GFP_KERNEL);
>> if (!denali->buf.buf)
>> return -ENOMEM;
>
> Just as a suggestion, maybe just replace this call with xzalloc,
> getting rid of meaningless GFP_KERNEL as well, and dropping the OOM
> check below?
Since kzalloc() is not a macro to xzalloc() anymore but uses calloc() instead,
which actually may return NULL, I am not sure if this is a better approach.
But I am not that deep into the topic of differences between *alloc calls to
definitely decide that.
Regards, Enrico
--
Pengutronix e.K. | Enrico Jörns |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5080 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nand: denali: remove undefined GFP_DMA flag
2018-11-14 15:14 [PATCH] nand: denali: remove undefined GFP_DMA flag Enrico Jorns
2018-11-14 22:55 ` Andrey Smirnov
@ 2018-11-19 8:08 ` Sascha Hauer
1 sibling, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2018-11-19 8:08 UTC (permalink / raw)
To: Enrico Jorns; +Cc: barebox
On Wed, Nov 14, 2018 at 04:14:54PM +0100, Enrico Jorns wrote:
> This was a remnant from porting kernel code to barebox.
> While being uncritical so far, this will now cause a compiler error
> since kzalloc is not a define but a static inline function.
>
> As the kzalloc() 'mode' argument was ignored before and still will be,
> it is safe to remove the parameter.
>
> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
> ---
> drivers/mtd/nand/nand_denali.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/nand_denali.c b/drivers/mtd/nand/nand_denali.c
> index 8b09b3722f..ef3395864c 100644
> --- a/drivers/mtd/nand/nand_denali.c
> +++ b/drivers/mtd/nand/nand_denali.c
> @@ -1387,7 +1387,7 @@ int denali_init(struct denali_nand_info *denali)
> }
>
> /* allocate a temporary buffer for nand_scan_ident() */
> - denali->buf.buf = kzalloc(PAGE_SIZE, GFP_DMA | GFP_KERNEL);
> + denali->buf.buf = kzalloc(PAGE_SIZE, GFP_KERNEL);
It's fine the way it is. The driver is from the Kernel, uses kzalloc in
other places, so fine to do so here aswell.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-11-19 8:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14 15:14 [PATCH] nand: denali: remove undefined GFP_DMA flag Enrico Jorns
2018-11-14 22:55 ` Andrey Smirnov
2018-11-16 9:43 ` Enrico Joerns
2018-11-19 8:08 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox