2019-04-29 15:21:43

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH 2/5] irqchip/renesas-irqc: Remove devm_kzalloc()/ioremap_nocache() error printing

There is no need to print a message if devm_kzalloc() or
ioremap_nocache() fails, as the memory allocation core already takes
care of that.

Signed-off-by: Geert Uytterhoeven <[email protected]>
---
drivers/irqchip/irq-renesas-irqc.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c
index 438a063c76156d98..0955ffe12b32eb36 100644
--- a/drivers/irqchip/irq-renesas-irqc.c
+++ b/drivers/irqchip/irq-renesas-irqc.c
@@ -133,7 +133,6 @@ static int irqc_probe(struct platform_device *pdev)

p = kzalloc(sizeof(*p), GFP_KERNEL);
if (!p) {
- dev_err(&pdev->dev, "failed to allocate driver data\n");
ret = -ENOMEM;
goto err0;
}
@@ -173,7 +172,6 @@ static int irqc_probe(struct platform_device *pdev)
/* ioremap IOMEM and setup read/write callbacks */
p->iomem = ioremap_nocache(io->start, resource_size(io));
if (!p->iomem) {
- dev_err(&pdev->dev, "failed to remap IOMEM\n");
ret = -ENXIO;
goto err2;
}
--
2.17.1


2019-04-30 08:14:21

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH 2/5] irqchip/renesas-irqc: Remove devm_kzalloc()/ioremap_nocache() error printing

Hello!

On 29.04.2019 18:20, Geert Uytterhoeven wrote:

> There is no need to print a message if devm_kzalloc() or

Just kzalloc() in this case.

> ioremap_nocache() fails, as the memory allocation core already takes
> care of that.
>
> Signed-off-by: Geert Uytterhoeven <[email protected]>
> ---
> drivers/irqchip/irq-renesas-irqc.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c
> index 438a063c76156d98..0955ffe12b32eb36 100644
> --- a/drivers/irqchip/irq-renesas-irqc.c
> +++ b/drivers/irqchip/irq-renesas-irqc.c
> @@ -133,7 +133,6 @@ static int irqc_probe(struct platform_device *pdev)
>
> p = kzalloc(sizeof(*p), GFP_KERNEL);
> if (!p) {
> - dev_err(&pdev->dev, "failed to allocate driver data\n");
> ret = -ENOMEM;
> goto err0;
> }
> @@ -173,7 +172,6 @@ static int irqc_probe(struct platform_device *pdev)
> /* ioremap IOMEM and setup read/write callbacks */
> p->iomem = ioremap_nocache(io->start, resource_size(io));
> if (!p->iomem) {
> - dev_err(&pdev->dev, "failed to remap IOMEM\n");
> ret = -ENXIO;

-ENOMEM?

[...]

MBR, Sergei

2019-04-30 12:03:34

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 2/5] irqchip/renesas-irqc: Remove devm_kzalloc()/ioremap_nocache() error printing

Hi Sergei,

On Tue, Apr 30, 2019 at 10:12 AM Sergei Shtylyov
<[email protected]> wrote:
> On 29.04.2019 18:20, Geert Uytterhoeven wrote:
> > There is no need to print a message if devm_kzalloc() or
>
> Just kzalloc() in this case.

Thanks, silly copy-and-paste error.

> > --- a/drivers/irqchip/irq-renesas-irqc.c
> > +++ b/drivers/irqchip/irq-renesas-irqc.c
> > @@ -173,7 +172,6 @@ static int irqc_probe(struct platform_device *pdev)
> > /* ioremap IOMEM and setup read/write callbacks */
> > p->iomem = ioremap_nocache(io->start, resource_size(io));
> > if (!p->iomem) {
> > - dev_err(&pdev->dev, "failed to remap IOMEM\n");
> > ret = -ENXIO;
>
> -ENOMEM?

I'd say yes, except that this error code is removed in patch [5/5], so I don't
think it's worth changing it in this patch.

Gr{oetje,eeting}s,

Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2019-05-13 15:06:02

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH 2/5] irqchip/renesas-irqc: Remove devm_kzalloc()/ioremap_nocache() error printing

On Mon, Apr 29, 2019 at 05:20:03PM +0200, Geert Uytterhoeven wrote:
> There is no need to print a message if devm_kzalloc() or
> ioremap_nocache() fails, as the memory allocation core already takes
> care of that.
>
> Signed-off-by: Geert Uytterhoeven <[email protected]>

Reviewed-by: Simon Horman <[email protected]>

> ---
> drivers/irqchip/irq-renesas-irqc.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c
> index 438a063c76156d98..0955ffe12b32eb36 100644
> --- a/drivers/irqchip/irq-renesas-irqc.c
> +++ b/drivers/irqchip/irq-renesas-irqc.c
> @@ -133,7 +133,6 @@ static int irqc_probe(struct platform_device *pdev)
>
> p = kzalloc(sizeof(*p), GFP_KERNEL);
> if (!p) {
> - dev_err(&pdev->dev, "failed to allocate driver data\n");
> ret = -ENOMEM;
> goto err0;
> }
> @@ -173,7 +172,6 @@ static int irqc_probe(struct platform_device *pdev)
> /* ioremap IOMEM and setup read/write callbacks */
> p->iomem = ioremap_nocache(io->start, resource_size(io));
> if (!p->iomem) {
> - dev_err(&pdev->dev, "failed to remap IOMEM\n");
> ret = -ENXIO;
> goto err2;
> }
> --
> 2.17.1
>