On Tue, Jul 23, 2019 at 12:16 PM Stephen Boyd <[email protected]> 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.

Nice. Would be nice to see this for other commonly called functions in
probe though we have deal with cases of failure being okay.

>
> // <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(...);

What about cases of pr_err, pr_warn, etc.? And the subsystem specific
prints like edac_printk and DRM_ERROR/DRM_DEV_ERROR.

There's also some cases that the irq seems to be optional. They use
dev_info, but will now have an error level print. That's fine with me,
but some may complain...

> )
> ...
> }
> // </smpl>
>
> Cc: Rob Herring <[email protected]>
> Cc: Bartlomiej Zolnierkiewicz <[email protected]>
> Cc: Javier Martinez Canillas <[email protected]>
> Cc: Andrzej Hajda <[email protected]>
> Cc: Mark Brown <[email protected]>
> Cc: Russell King - ARM Linux <[email protected]>
> Cc: Marek Szyprowski <[email protected]>
> Cc: Rafael J. Wysocki <[email protected]>
> Cc: Andy Shevchenko <[email protected]>
> Signed-off-by: Stephen Boyd <[email protected]>

Reply via email to