Re: [PATCH v6 25/57] media: Remove dev_err() usage after platform_get_irq()

From: Geert Uytterhoeven
Date: Thu Aug 08 2019 - 03:57:05 EST


Hi Stephen,

On Tue, Jul 30, 2019 at 8:21 PM Stephen Boyd <swboyd@xxxxxxxxxxxx> wrote:
> We don't need dev_err() messages when platform_get_irq() fails now that
> platform_get_irq() prints an error message itself when something goes
> wrong. Let's remove these prints with a simple semantic patch.
>
> // <smpl>
> @@
> expression ret;
> struct platform_device *E;
> @@
>
> ret =
> (
> platform_get_irq(E, ...)
> |
> platform_get_irq_byname(E, ...)
> );
>
> if ( \( ret < 0 \| ret <= 0 \) )
> {
> (
> -if (ret != -EPROBE_DEFER)
> -{ ...
> -dev_err(...);
> -... }
> |
> ...
> -dev_err(...);
> )
> ...
> }
> // </smpl>
>
> While we're here, remove braces on if statements that only have one
> statement (manually).
>
> Cc: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
> Cc: linux-media@xxxxxxxxxxxxxxx
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Stephen Boyd <swboyd@xxxxxxxxxxxx>
> ---
>
> Please apply directly to subsystem trees
>
> drivers/media/platform/am437x/am437x-vpfe.c | 1 -
> drivers/media/platform/atmel/atmel-sama5d2-isc.c | 7 ++-----
> drivers/media/platform/exynos4-is/mipi-csis.c | 4 +---
> drivers/media/platform/imx-pxp.c | 4 +---
> drivers/media/platform/omap3isp/isp.c | 1 -
> drivers/media/platform/renesas-ceu.c | 4 +---
> drivers/media/platform/rockchip/rga/rga.c | 1 -
> drivers/media/platform/s3c-camif/camif-core.c | 4 +---
> drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 8 ++------
> drivers/media/platform/sti/hva/hva-hw.c | 8 ++------
> drivers/media/platform/stm32/stm32-dcmi.c | 5 +----
> drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 7 ++-----
> drivers/media/rc/img-ir/img-ir-core.c | 4 +---
> drivers/media/rc/ir-hix5hd2.c | 4 +---
> drivers/media/rc/meson-ir.c | 4 +---
> drivers/media/rc/mtk-cir.c | 4 +---
> drivers/media/rc/sunxi-cir.c | 1 -
> 17 files changed, 17 insertions(+), 54 deletions(-)

Looks like this didn't catch the double assignments in:

drivers/media/platform/rcar_fdp1.c: fdp1->irq = ret =
platform_get_irq(pdev, 0);
drivers/media/platform/rcar_fdp1.c- if (ret < 0) {
drivers/media/platform/rcar_fdp1.c- dev_err(&pdev->dev,
"cannot find IRQ\n");
drivers/media/platform/rcar_fdp1.c- return ret;
drivers/media/platform/rcar_fdp1.c- }
drivers/media/platform/rcar_fdp1.c-
--
drivers/media/platform/rcar_jpu.c: jpu->irq = ret =
platform_get_irq(pdev, 0);
drivers/media/platform/rcar_jpu.c- if (ret < 0) {
drivers/media/platform/rcar_jpu.c- dev_err(&pdev->dev,
"cannot find IRQ\n");
drivers/media/platform/rcar_jpu.c- return ret;
drivers/media/platform/rcar_jpu.c- }
drivers/media/platform/rcar_jpu.c-

Gr{oetje,eeting}s,

Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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