2022-02-11 00:14:42

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 5/9] pata_mpc52xx: use GFP_KERNEL

Platform_driver probe functions aren't called with locks held
and thus don't need GFP_ATOMIC. Use GFP_KERNEL instead.

Problem found with Coccinelle.

Signed-off-by: Julia Lawall <[email protected]>

---
drivers/ata/pata_mpc52xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
index c1b138d24b05..a2a3a95c71ed 100644
--- a/drivers/ata/pata_mpc52xx.c
+++ b/drivers/ata/pata_mpc52xx.c
@@ -736,7 +736,7 @@ static int mpc52xx_ata_probe(struct platform_device *op)
}

/* Prepare our private structure */
- priv = devm_kzalloc(&op->dev, sizeof(*priv), GFP_ATOMIC);
+ priv = devm_kzalloc(&op->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) {
rv = -ENOMEM;
goto err1;



2022-02-11 10:48:51

by Sergey Shtylyov

[permalink] [raw]
Subject: Re: [PATCH 5/9] pata_mpc52xx: use GFP_KERNEL

On 2/10/22 11:42 PM, Julia Lawall wrote:

> Platform_driver probe functions aren't called with locks held
> and thus don't need GFP_ATOMIC. Use GFP_KERNEL instead.
>
> Problem found with Coccinelle.
>
> Signed-off-by: Julia Lawall <[email protected]>

Reviewed-by: Sergey Shtylyov <[email protected]>

[...]

MBR, Sergey

2022-02-11 12:24:40

by Damien Le Moal

[permalink] [raw]
Subject: Re: [PATCH 5/9] pata_mpc52xx: use GFP_KERNEL

On 2/11/22 05:42, Julia Lawall wrote:
> Platform_driver probe functions aren't called with locks held
> and thus don't need GFP_ATOMIC. Use GFP_KERNEL instead.
>
> Problem found with Coccinelle.
>
> Signed-off-by: Julia Lawall <[email protected]>

Applied to for-5.18. Thanks !


--
Damien Le Moal
Western Digital Research