Linux Input/HID development
 help / color / mirror / Atom feed
* Re: [PATCH 01/32] Input: cyttsp5 - Use %pe format specifier
From: Frank Li @ 2025-10-13 15:35 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman,
	linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging
In-Reply-To: <20251013-ptr_err-v1-1-2c5efbd82952@chromium.org>

On Mon, Oct 13, 2025 at 02:14:41PM +0000, Ricardo Ribalda wrote:
> The %pe format specifier is designed to print error pointers. It prints
> a symbolic error name (eg. -EINVAL) and it makes the code simpler by
> omitting PTR_ERR()
>
> This patch fixes this cocci report:
> ./cyttsp5.c:927:3-10: WARNING: Consider using %pe to print PTR_ERR()
>
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
>  drivers/input/touchscreen/cyttsp5.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Suppose it will go though input subsystem intead of media.
Need post seperated at difference thread?

Frank

>
> diff --git a/drivers/input/touchscreen/cyttsp5.c b/drivers/input/touchscreen/cyttsp5.c
> index 071b7c9bf566eb0b58e302a941ec085be1eb5683..47f4271395a69b8350f9be7266b57fe11d442ee3 100644
> --- a/drivers/input/touchscreen/cyttsp5.c
> +++ b/drivers/input/touchscreen/cyttsp5.c
> @@ -923,8 +923,8 @@ static int cyttsp5_i2c_probe(struct i2c_client *client)
>
>  	regmap = devm_regmap_init_i2c(client, &config);
>  	if (IS_ERR(regmap)) {
> -		dev_err(&client->dev, "regmap allocation failed: %ld\n",
> -			PTR_ERR(regmap));
> +		dev_err(&client->dev, "regmap allocation failed: %pe\n",
> +			regmap);
>  		return PTR_ERR(regmap);
>  	}
>
>
> --
> 2.51.0.760.g7b8bcc2412-goog
>

^ permalink raw reply

* Re: [PATCH 12/32] media: i2c: max9286: Use %pe format specifier
From: Kieran Bingham @ 2025-10-13 15:09 UTC (permalink / raw)
  To: Alim Akhtar, Andrew-CT Chen, AngeloGioacchino Del Regno,
	Benjamin Mugnier, Bingbu Cao, Dafna Hirschfeld, Daniel Scally,
	Dave Stevenson, Dmitry Torokhov, Fabio Estevam,
	Greg Kroah-Hartman, Hans Verkuil, Heiko Stuebner, Jacopo Mondi,
	Jacopo Mondi, Julien Massot, Krzysztof Hałasa,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart, Leon Luo,
	Linus Walleij
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-12-2c5efbd82952@chromium.org>

Quoting Ricardo Ribalda (2025-10-13 15:14:52)
> The %pe format specifier is designed to print error pointers. It prints
> a symbolic error name (eg. -EINVAL) and it makes the code simpler by
> omitting PTR_ERR().
> 
> This patch fixes this cocci report:
> ./i2c/max9286.c:755:7-14: WARNING: Consider using %pe to print PTR_ERR()
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
>  drivers/media/i2c/max9286.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
> index 7c0961688d6173843f3ae846253d4a8669ae762b..e6e214f8294b83105be02f29966e1d3ed72f8dbe 100644
> --- a/drivers/media/i2c/max9286.c
> +++ b/drivers/media/i2c/max9286.c
> @@ -751,8 +751,8 @@ static int max9286_v4l2_notifier_register(struct max9286_priv *priv)
>                 mas = v4l2_async_nf_add_fwnode(&priv->notifier, source->fwnode,
>                                                struct max9286_asd);
>                 if (IS_ERR(mas)) {
> -                       dev_err(dev, "Failed to add subdev for source %u: %ld",
> -                               i, PTR_ERR(mas));
> +                       dev_err(dev, "Failed to add subdev for source %u: %pe",
> +                               i, mas);

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

>                         v4l2_async_nf_cleanup(&priv->notifier);
>                         return PTR_ERR(mas);
>                 }
> 
> -- 
> 2.51.0.760.g7b8bcc2412-goog
> 
> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply

* Re: [PATCH 10/32] media: i2c: imx335: Use %pe format specifier
From: Kieran Bingham @ 2025-10-13 15:06 UTC (permalink / raw)
  To: Alim Akhtar, Andrew-CT Chen, AngeloGioacchino Del Regno,
	Benjamin Mugnier, Bingbu Cao, Dafna Hirschfeld, Daniel Scally,
	Dave Stevenson, Dmitry Torokhov, Fabio Estevam,
	Greg Kroah-Hartman, Hans Verkuil, Heiko Stuebner, Jacopo Mondi,
	Jacopo Mondi, Julien Massot, Krzysztof Hałasa,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart, Leon Luo,
	Linus Walleij
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <176036780330.559803.287308146210017676@ping.linuxembedded.co.uk>

Quoting Kieran Bingham (2025-10-13 16:03:23)
> Quoting Ricardo Ribalda (2025-10-13 15:14:50)
> > The %pe format specifier is designed to print error pointers. It prints
> > a symbolic error name (eg. -EINVAL) and it makes the code simpler by
> > omitting PTR_ERR().
> > 
> > This patch fixes this cocci report:
> > ./i2c/imx335.c:1013:3-10: WARNING: Consider using %pe to print PTR_ERR()
> 
> Ohhh nice. Is this new ? First I've come across it.
> 
> 
> 
> > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> > ---
> >  drivers/media/i2c/imx335.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
> > index c043df2f15fb25b3a56422092f99a1fd9a508fa9..71ed9a0d84a252ee362621c4d38001508fb86d28 100644
> > --- a/drivers/media/i2c/imx335.c
> > +++ b/drivers/media/i2c/imx335.c
> > @@ -1009,8 +1009,8 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
> >         imx335->reset_gpio = devm_gpiod_get_optional(imx335->dev, "reset",
> >                                                      GPIOD_OUT_HIGH);
> >         if (IS_ERR(imx335->reset_gpio)) {
> > -               dev_err(imx335->dev, "failed to get reset gpio %ld\n",
> > -                       PTR_ERR(imx335->reset_gpio));
> > +               dev_err(imx335->dev, "failed to get reset gpio %pe\n",
> > +                       imx335->reset_gpio);
> 
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 

I see imx335->inclk is checked with PTR_ERR below too - but isn't
currently printed, so I think it's out of scope for this series - but
probably worth using the new helper to report that failure too in the
future.

I'll see if there's some error handling clean up to be done on top
later.

> >                 return PTR_ERR(imx335->reset_gpio);
> >         }
> >  
> > 
> > -- 
> > 2.51.0.760.g7b8bcc2412-goog
> >

^ permalink raw reply

* Re: [PATCH 10/32] media: i2c: imx335: Use %pe format specifier
From: Kieran Bingham @ 2025-10-13 15:03 UTC (permalink / raw)
  To: Alim Akhtar, Andrew-CT Chen, AngeloGioacchino Del Regno,
	Benjamin Mugnier, Bingbu Cao, Dafna Hirschfeld, Daniel Scally,
	Dave Stevenson, Dmitry Torokhov, Fabio Estevam,
	Greg Kroah-Hartman, Hans Verkuil, Heiko Stuebner, Jacopo Mondi,
	Jacopo Mondi, Julien Massot, Krzysztof Hałasa,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart, Leon Luo,
	Linus Walleij
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-10-2c5efbd82952@chromium.org>

Quoting Ricardo Ribalda (2025-10-13 15:14:50)
> The %pe format specifier is designed to print error pointers. It prints
> a symbolic error name (eg. -EINVAL) and it makes the code simpler by
> omitting PTR_ERR().
> 
> This patch fixes this cocci report:
> ./i2c/imx335.c:1013:3-10: WARNING: Consider using %pe to print PTR_ERR()

Ohhh nice. Is this new ? First I've come across it.



> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
>  drivers/media/i2c/imx335.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
> index c043df2f15fb25b3a56422092f99a1fd9a508fa9..71ed9a0d84a252ee362621c4d38001508fb86d28 100644
> --- a/drivers/media/i2c/imx335.c
> +++ b/drivers/media/i2c/imx335.c
> @@ -1009,8 +1009,8 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
>         imx335->reset_gpio = devm_gpiod_get_optional(imx335->dev, "reset",
>                                                      GPIOD_OUT_HIGH);
>         if (IS_ERR(imx335->reset_gpio)) {
> -               dev_err(imx335->dev, "failed to get reset gpio %ld\n",
> -                       PTR_ERR(imx335->reset_gpio));
> +               dev_err(imx335->dev, "failed to get reset gpio %pe\n",
> +                       imx335->reset_gpio);

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

>                 return PTR_ERR(imx335->reset_gpio);
>         }
>  
> 
> -- 
> 2.51.0.760.g7b8bcc2412-goog
>

^ permalink raw reply

* Re: [PATCH 27/32] media: renesas: vsp1: Use %pe format specifier
From: Geert Uytterhoeven @ 2025-10-13 14:42 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman,
	linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging
In-Reply-To: <20251013-ptr_err-v1-27-2c5efbd82952@chromium.org>

On Mon, 13 Oct 2025 at 16:24, Ricardo Ribalda <ribalda@chromium.org> wrote:
> The %pe format specifier is designed to print error pointers. It prints
> a symbolic error name (eg. -EINVAL) and it makes the code simpler by
> omitting PTR_ERR().
>
> This patch fixes this cocci report:
> ./platform/renesas/vsp1/vsp1_drv.c:958:4-11: WARNING: Consider using %pe to print PTR_ERR()
>
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply

* Re: [PATCH v3 04/11] HID: haptic: introduce hid_haptic_device
From: Benjamin Tissoires @ 2025-10-13 14:29 UTC (permalink / raw)
  To: Jonathan Denose
  Cc: Randy Dunlap, Thorsten Leemhuis, Jiri Kosina, Dmitry Torokhov,
	Jonathan Corbet, Henrik Rydberg, linux-input, linux-kernel,
	linux-doc, Angela Czubak, Sean O'Brien, Lucas GISSOT
In-Reply-To: <CAMCVhVMO4y9P=Y3SWvY6BvA1sUK2o=Gn6Hk2UpaueNN=6CNHZQ@mail.gmail.com>

On Oct 13 2025, Jonathan Denose wrote:
> On Fri, Oct 10, 2025 at 5:52 PM Randy Dunlap <rdunlap@infradead.org> wrote:
> >
> >
> >
> > On 10/10/25 1:30 PM, Jonathan Denose wrote:
> > > Hi all,
> > >
> > > Thanks for looking into this.
> > >
> > > On Fri, Oct 10, 2025 at 1:55 PM Randy Dunlap <rdunlap@infradead.org> wrote:
> > >>
> > >> Hi,
> > >>
> > >> I think I found it... see below.
> > >>
> > >>
> > >> On 10/9/25 11:48 PM, Thorsten Leemhuis wrote:
> > >>> [Top-Posting for easier consumption]
> > >>>
> > >>> Mainly writing this mail to bring Lucas GISSOT in here, who reported the
> > >>> same error yesterday here:
> > >>> https://lore.kernel.org/all/aOgvA8Jiofcnk2xb@ARSENIURE.localdomain/
> > >>>
> > >>> Lucas there suggested:
> > >>> """but it seems to me that the #if IS_ENABLED(CONFIG_HID_HAPTIC) in
> > >>> hid-haptic.h should be replaced by IS_BUILTIN(CONFIG_HID_HAPTIC) and
> > >>> Kconfig updated."""
> > >>>
> > >>> And Randy: Thx for the closer investigation! It explains some of the
> > >>> "that feels odd, am I holding this wrong" feeling I had when reporting this.
> > >>>
> > >>> Ciao, Thorsten
> > >>>
> > >>> On 10/10/25 06:50, Randy Dunlap wrote:
> > >>>> On 10/9/25 7:43 AM, Thorsten Leemhuis wrote:
> > >>>>> On 8/19/25 01:08, Jonathan Denose wrote:
> > >>>>>> From: Angela Czubak <aczubak@google.com>
> > >>>>>>
> > >>>>>> Define a new structure that contains simple haptic device configuration
> > >>>>>> as well as current state.
> > >>>>>> Add functions that recognize auto trigger and manual trigger reports
> > >>>>>> as well as save their addresses.Hi,
> > >>>>>> Verify that the pressure unit is either grams or newtons.
> > >>>>>> Mark the input device as a haptic touchpad if the unit is correct and
> > >>>>>> the reports are found.
> > >>>>>>  [...]
> > >>>>>> +config HID_HAPTIC
> > >>>>>> +  tristate "Haptic touchpad support"
> > >>>>>> +  default n
> > >>>>>> +  help
> > >>>>>> +  Support for touchpads with force sensors and haptic actuators instead of a
> > >>>>>> +  traditional button.
> > >>>>>> +  Adds extra parsing and FF device for the hid multitouch driver.
> > >>>>>> +  It can be used for Elan 2703 haptic touchpad.
> > >>>>>> +
> > >>>>>> +  If unsure, say N.
> > >>>>>> +
> > >>>>>>  menu "Special HID drivers"
> > >>>>>
> > >>>>> I suspect this change is related to a build error I ran into today:
> > >>>>>
> > >>>>>   MODPOST Module.symvers
> > >>>>> ERROR: modpost: "hid_haptic_init" [drivers/hid/hid-multitouch.ko] undefined!
> > >>>>> ERROR: modpost: "hid_haptic_pressure_increase" [drivers/hid/hid-multitouch.ko] undefined!
> > >>>>> ERROR: modpost: "hid_haptic_check_pressure_unit" [drivers/hid/hid-multitouch.ko] undefined!
> > >>>>> ERROR: modpost: "hid_haptic_input_configured" [drivers/hid/hid-multitouch.ko] undefined!
> > >>>>> ERROR: modpost: "hid_haptic_input_mapping" [drivers/hid/hid-multitouch.ko] undefined!
> > >>>>> ERROR: modpost: "hid_haptic_feature_mapping" [drivers/hid/hid-multitouch.ko] undefined!
> > >>>>> ERROR: modpost: "hid_haptic_pressure_reset" [drivers/hid/hid-multitouch.ko] undefined!
> > >>>>> make[3]: *** [/home/thl/var/linux.dev/scripts/Makefile.modpost:147: Module.symvers] Error 1
> > >>>>>
> > >>>>> The config where this occurred had this:
> > >>>>>
> > >>>>> CONFIG_HID=y
> > >>>>> CONFIG_HID_MULTITOUCH=m
> > >>>>> CONFIG_HID_HAPTIC=m
> > >>>>>
> > >>>>> Changing the latter to "CONFIG_HID_HAPTIC=y" fixed the problem for me.
> > >>>>
> > >>>> Sure, but that's just covering up the problem.
> > >>>>> First, I get this build error:
> > >>>>
> > >>>> ERROR: modpost: missing MODULE_LICENSE() in drivers/hid/hid-haptic.o
> > >>>> WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hid/hid-haptic.o
> > >>>>
> > >>
> > >> ISTM that tristate is incompatible with this newly added Makefile
> > >> line:
> > >>
> > >> +hid-$(CONFIG_HID_HAPTIC)       += hid-haptic.o
> > >>
> > >> hid-* lists files that should be builtin, not loadable modules.
> > >> These should all be hid-y.  AFAIK, hid-m is not useful.
> > >> (A maintainer can correct me as needed.)
> >
> > More correctly, any .o that is listed as being built as part of
> > hid.o should is going to be controlled by CONFIG_HID and should
> > not its own have a Kconfig symbol at all.
> >
> > E.g. here:
> >  hid-y                  := hid-core.o hid-input.o hid-quirks.o
> > hid-core, hid-input, and hid-quirks don't have their own
> > Kconfig symbols.
> >
> >
> >
> > >> So adding a MODULE_LICENSE() and MODULE_DESCRIPTION() to
> > >> hid-haptic.c and changing drivers/hid/Makefile to use
> > >> obj-$(CONFIG_HID_HAPTIC_        += hid-haptic.o
> > >>
> > >> fixes the build errors for me.
> > >>
> > >> Angela, Jonathan D., is there any reason that
> > >> hid-haptic needs to be builtin instead of a loadable
> > >> module?  It's no problem for hid-multitouch.ko to call
> > >> into hid-haptic.ko (both as loadable modules) as long as
> > >> hid-haptic.ko is loaded first.
> > >>
> > > As long as hid-multitouch.ko is able to call into hid-haptic.ko I
> > > don't see any issues, but is there a way to enforce that when
> > > CONFIG_HID_HAPTIC is enabled, hid-haptic.ko will be loaded before
> > > hid-multitouch.ko?
> >
> > I only know of two possibilities though there may be more.
> >
> > a. use request_module(true, "hid-haptic");
> >
> > This would probably be used in the hid core somewhere, afterthe device matching is done.
> >
> > b. use udev. When a device that needs hid-multitouch is
> > discovered, have udev load both hid-haptic and hid-multitouch.
> >
> >
> > I see that hid-haptic.h is written so that it has stubs for
> > when CONFIG_HID_HAPTIC is not enabled. Can hid-multitouch
> > operate (in a reduced capacity) when HID_HAPTIC is not enabled?
> > So that they are separate modules and hid-multitouch is not
> > dependent on hid-haptic?
> >
> > There is probably a use case for hid-multitouch without having
> > hid-haptic loaded since hid-multitouch existed without having
> > hid-haptic around at all.
> >
> > It seems that you want both of them loaded. And then Lucas
> > has reported a build error when HID_HAPTIC=m and
> > HID_MULTITOUCH=y, so either (like Lucas said) HID_HAPTIC
> > should be bool, not tristate; or in Kconfig,
> > HID_MULTITOUCH should depend on HID_HAPTIC, which would not
> > allow the problem config that Lucas reported.
> > But that forces devices that want HID_MULTITOUCH to also
> > have HID_HAPTIC loaded, even though they may not need it.

One way around it is to declare a stub struct haptic_operations and let
hid-haptic.ko fill in the function pointers when it loads and remove
them when it unloads. But it can be a little bit tedious, especially
because making it properly working involves RCUs (we don't want to have
mutexes everywhere).

> >
> The idea behind these patches was that hid-haptic would depend on
> hid-multitouch but not the other way around. I am fine changing
> HID_HAPTIC to bool. That's what I had it as initially, but I was asked
> to change it.
> 
> If everyone else is fine with that, I can send out a patch.

I'd still prefer hid-haptic to be tristate, just because
input_ff_memless is tristate as well. Right now distributions don't
support the FF bits, so enforcing this into the kernel seems a little
bit harsh on them and difficult to debug for early adopters.

That being said, that build failure is pretty bad. So please send a
(temporary) fix ASAP. If making it boolean solves the issue, then yes,
send a boolean fix and then we can revisit it. But right now the urgency
is to fix that.

And if making it proper tristate is too hard, then we can leave with
bool.

Cheers,
Benjamin

> > --
> > ~Randy
> >
> -- 
> Jonathan

^ permalink raw reply

* [PATCH 32/32] media: staging/ipu7: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:15 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./ipu7/ipu7-isys-csi-phy.c:311:23-30: WARNING: Consider using %pe to print PTR_ERR()
./ipu7/ipu7-isys-csi2.c:59:22-29: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/staging/media/ipu7/ipu7-isys-csi-phy.c | 4 ++--
 drivers/staging/media/ipu7/ipu7-isys-csi2.c    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/ipu7/ipu7-isys-csi-phy.c b/drivers/staging/media/ipu7/ipu7-isys-csi-phy.c
index b8c5db7ae3009e16264d7aaca6d4d237c1402ab7..2d57178835188a44b002b38712437cbd551751a5 100644
--- a/drivers/staging/media/ipu7/ipu7-isys-csi-phy.c
+++ b/drivers/staging/media/ipu7/ipu7-isys-csi-phy.c
@@ -307,8 +307,8 @@ static int ipu7_isys_csi_ctrl_dids_config(struct ipu7_isys_csi2 *csi2, u32 id)
 
 	pad = media_entity_remote_source_pad_unique(&csi2->asd.sd.entity);
 	if (IS_ERR(pad)) {
-		dev_warn(dev, "can't get remote source pad of %s (%ld)\n",
-			 csi2->asd.sd.name, PTR_ERR(pad));
+		dev_warn(dev, "can't get remote source pad of %s (%pe)\n",
+			 csi2->asd.sd.name, pad);
 		return PTR_ERR(pad);
 	}
 
diff --git a/drivers/staging/media/ipu7/ipu7-isys-csi2.c b/drivers/staging/media/ipu7/ipu7-isys-csi2.c
index 4023db4a6466dd57f0ac007847bdd74bcdf394f7..f34eabfe8a985f29fa48b4a8896a058fde2f2b2f 100644
--- a/drivers/staging/media/ipu7/ipu7-isys-csi2.c
+++ b/drivers/staging/media/ipu7/ipu7-isys-csi2.c
@@ -55,8 +55,8 @@ s64 ipu7_isys_csi2_get_link_freq(struct ipu7_isys_csi2 *csi2)
 	src_pad = media_entity_remote_source_pad_unique(&csi2->asd.sd.entity);
 	if (IS_ERR(src_pad)) {
 		dev_err(&csi2->isys->adev->auxdev.dev,
-			"can't get source pad of %s (%ld)\n",
-			csi2->asd.sd.name, PTR_ERR(src_pad));
+			"can't get source pad of %s (%pe)\n",
+			csi2->asd.sd.name, src_pad);
 		return PTR_ERR(src_pad);
 	}
 

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 29/32] media: samsung: exynos4-is: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:15 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./platform/samsung/exynos4-is/media-dev.c:1337:16-23: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/platform/samsung/exynos4-is/media-dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/samsung/exynos4-is/media-dev.c b/drivers/media/platform/samsung/exynos4-is/media-dev.c
index c781853586fd21996105c050e587bf8079cfc095..d6f7601de597e3d3517ef9195d728deb578e74f1 100644
--- a/drivers/media/platform/samsung/exynos4-is/media-dev.c
+++ b/drivers/media/platform/samsung/exynos4-is/media-dev.c
@@ -1333,8 +1333,8 @@ static int fimc_md_register_clk_provider(struct fimc_md *fmd)
 
 		cp->clks[i] = clk_register(NULL, &camclk->hw);
 		if (IS_ERR(cp->clks[i])) {
-			dev_err(dev, "failed to register clock: %s (%ld)\n",
-					init.name, PTR_ERR(cp->clks[i]));
+			dev_err(dev, "failed to register clock: %s (%pe)\n",
+				init.name, cp->clks[i]);
 			ret = PTR_ERR(cp->clks[i]);
 			goto err;
 		}

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 30/32] media: ti: cal Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:15 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./platform/ti/cal/cal.c:1111:3-10: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/platform/ti/cal/cal.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/platform/ti/cal/cal.c b/drivers/media/platform/ti/cal/cal.c
index b644ed890412104887ce3ec32b5024a02a9676c8..3e25ce0c3c3bdce3434d19c416481bd8d8b838f5 100644
--- a/drivers/media/platform/ti/cal/cal.c
+++ b/drivers/media/platform/ti/cal/cal.c
@@ -1107,8 +1107,7 @@ static int cal_init_camerarx_regmap(struct cal_dev *cal)
 		return 0;
 	}
 
-	dev_warn(cal->dev, "failed to get ti,camerrx-control: %ld\n",
-		 PTR_ERR(syscon));
+	dev_warn(cal->dev, "failed to get ti,camerrx-control: %pe\n", syscon);
 
 	/*
 	 * Backward DTS compatibility. If syscon entry is not present then

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 26/32] media: platform: rzg2l-cru: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:15 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./platform/renesas/rzg2l-cru/rzg2l-csi2.c:307:30-37: WARNING: Consider using %pe to print PTR_ERR()
./platform/renesas/rzg2l-cru/rzg2l-csi2.c:726:30-37: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c
index 1520211e74185fea3bca85f36239254f6b4651db..0fbdae280fdc49f963269a4bdaea38ff2e51884e 100644
--- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c
+++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c
@@ -303,8 +303,8 @@ static int rzg2l_csi2_calc_mbps(struct rzg2l_csi2 *csi2)
 
 	remote_pad = media_pad_remote_pad_unique(&csi2->pads[RZG2L_CSI2_SINK]);
 	if (IS_ERR(remote_pad)) {
-		dev_err(csi2->dev, "can't get source pad of %s (%ld)\n",
-			csi2->remote_source->name, PTR_ERR(remote_pad));
+		dev_err(csi2->dev, "can't get source pad of %s (%pe)\n",
+			csi2->remote_source->name, remote_pad);
 		return PTR_ERR(remote_pad);
 	}
 
@@ -722,8 +722,8 @@ static int rzg2l_csi2_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
 
 	remote_pad = media_pad_remote_pad_unique(&csi2->pads[RZG2L_CSI2_SINK]);
 	if (IS_ERR(remote_pad)) {
-		dev_err(csi2->dev, "can't get source pad of %s (%ld)\n",
-			csi2->remote_source->name, PTR_ERR(remote_pad));
+		dev_err(csi2->dev, "can't get source pad of %s (%pe)\n",
+			csi2->remote_source->name, remote_pad);
 		return PTR_ERR(remote_pad);
 	}
 	return v4l2_subdev_call(csi2->remote_source, pad, get_frame_desc,

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 28/32] media: rkisp1: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:15 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./platform/rockchip/rkisp1/rkisp1-isp.c:940:3-10: WARNING: Consider using %pe to print PTR_ERR()
./platform/rockchip/rkisp1/rkisp1-csi.c:372:3-10: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c | 4 ++--
 drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c
index 841e58c20f7fcb484643138627413425a049d1fa..ddc6182f3e4bdacdd1962c86f6259334b16aa505 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c
@@ -368,8 +368,8 @@ static int rkisp1_csi_s_stream(struct v4l2_subdev *sd, int enable)
 
 	source_pad = media_entity_remote_source_pad_unique(&sd->entity);
 	if (IS_ERR(source_pad)) {
-		dev_dbg(rkisp1->dev, "Failed to get source for CSI: %ld\n",
-			PTR_ERR(source_pad));
+		dev_dbg(rkisp1->dev, "Failed to get source for CSI: %pe\n",
+			source_pad);
 		return -EPIPE;
 	}
 
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
index 8c29a1c9309a846152d212dcb50b7bf991d4f422..147d33eb6ee0d975b257c5df2997b811ba3a62e1 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
@@ -936,8 +936,8 @@ static int rkisp1_isp_s_stream(struct v4l2_subdev *sd, int enable)
 	sink_pad = &isp->pads[RKISP1_ISP_PAD_SINK_VIDEO];
 	source_pad = media_pad_remote_pad_unique(sink_pad);
 	if (IS_ERR(source_pad)) {
-		dev_dbg(rkisp1->dev, "Failed to get source for ISP: %ld\n",
-			PTR_ERR(source_pad));
+		dev_dbg(rkisp1->dev, "Failed to get source for ISP: %pe\n",
+			source_pad);
 		return -EPIPE;
 	}
 

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 24/32] media: mediatek: vcodec: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:15 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c:187:3-10: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c
index 5ad3797836db15bb62744d6699cdd2d6f05ad01b..643d6fff088b22dd58c0b05d5699432ccd0bc582 100644
--- a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c
+++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c
@@ -183,8 +183,8 @@ static void mtk_vcodec_dbgfs_vdec_init(struct mtk_vcodec_dec_dev *vcodec_dev)
 
 	vcodec_dev->dbgfs.vcodec_root = debugfs_create_dir("vcodec-dec", NULL);
 	if (IS_ERR(vcodec_dev->dbgfs.vcodec_root))
-		dev_err(&vcodec_dev->plat_dev->dev, "create vcodec dir err:%ld\n",
-			PTR_ERR(vcodec_dev->dbgfs.vcodec_root));
+		dev_err(&vcodec_dev->plat_dev->dev, "create vcodec dir err:%pe\n",
+			vcodec_dev->dbgfs.vcodec_root);
 
 	vcodec_root = vcodec_dev->dbgfs.vcodec_root;
 	debugfs_create_x32("mtk_v4l2_dbg_level", 0644, vcodec_root, &mtk_v4l2_dbg_level);

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 31/32] media: staging: ipu3-imgu: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:15 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./ipu3/ipu3.c:534:5-12: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/staging/media/ipu3/ipu3.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/media/ipu3/ipu3.c b/drivers/staging/media/ipu3/ipu3.c
index e22a9c0921957ef2fbf7b8a11fab28e6d78c60eb..bdf5a457752b24bf35e38491d63fc1e059a1e058 100644
--- a/drivers/staging/media/ipu3/ipu3.c
+++ b/drivers/staging/media/ipu3/ipu3.c
@@ -530,8 +530,7 @@ static irqreturn_t imgu_isr_threaded(int irq, void *imgu_ptr)
 		if (IS_ERR(b)) {
 			if (PTR_ERR(b) != -EBUSY)	/* All done */
 				dev_err(&imgu->pci_dev->dev,
-					"failed to dequeue buffers (%ld)\n",
-					PTR_ERR(b));
+					"failed to dequeue buffers (%pe)\n", b);
 			break;
 		}
 

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 25/32] media: imx8mq-mipi-csi2: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:15 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./platform/nxp/imx8mq-mipi-csi2.c:422:23-30: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
index 3a4645f59a44028fdca82a4d8393e1a0a6ba88f0..d333ff43539f061b8b9cf88af2cda8c44b3ec2a9 100644
--- a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
+++ b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
@@ -418,8 +418,8 @@ static int imx8mq_mipi_csi_calc_hs_settle(struct csi_state *state,
 
 	src_pad = media_entity_remote_source_pad_unique(&sd_state->sd->entity);
 	if (IS_ERR(src_pad)) {
-		dev_err(state->dev, "can't get source pad of %s (%ld)\n",
-			sd_state->sd->name, PTR_ERR(src_pad));
+		dev_err(state->dev, "can't get source pad of %s (%pe)\n",
+			sd_state->sd->name, src_pad);
 		return PTR_ERR(src_pad);
 	}
 

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 27/32] media: renesas: vsp1: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:15 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./platform/renesas/vsp1/vsp1_drv.c:958:4-11: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/platform/renesas/vsp1/vsp1_drv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drv.c b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
index 6c64657fc4f3366f27bb63dea56f535519af20fd..2de515c497eb8557602ec946de527823f07ab11f 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
@@ -954,8 +954,7 @@ static int vsp1_probe(struct platform_device *pdev)
 		vsp1->fcp = rcar_fcp_get(fcp_node);
 		of_node_put(fcp_node);
 		if (IS_ERR(vsp1->fcp)) {
-			dev_dbg(&pdev->dev, "FCP not found (%ld)\n",
-				PTR_ERR(vsp1->fcp));
+			dev_dbg(&pdev->dev, "FCP not found (%pe)\n", vsp1->fcp);
 			return PTR_ERR(vsp1->fcp);
 		}
 

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 22/32] media: ipu3-cio2: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:15 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./pci/intel/ipu3/ipu3-cio2.c:318:19-26: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/pci/intel/ipu3/ipu3-cio2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
index a87f105beb5e267fd450b8a36ef9b0e0ecafc598..986b9afd7cb5b6a07c796b4333f93d427a8c4fbe 100644
--- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c
+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
@@ -314,8 +314,8 @@ static int cio2_csi2_calc_timing(struct cio2_device *cio2, struct cio2_queue *q,
 
 	src_pad = media_entity_remote_source_pad_unique(&q->subdev.entity);
 	if (IS_ERR(src_pad)) {
-		dev_err(dev, "can't get source pad of %s (%ld)\n",
-			q->subdev.name, PTR_ERR(src_pad));
+		dev_err(dev, "can't get source pad of %s (%pe)\n",
+			q->subdev.name, src_pad);
 		return PTR_ERR(src_pad);
 	}
 

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 20/32] media: i2c: st-mipid02: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:15 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./i2c/st-mipid02.c:751:3-10: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/i2c/st-mipid02.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c
index 41ae25b0911f02517f137d6b5307d13154266e07..4675181af5fb00df837c8b796fc32d50e077a480 100644
--- a/drivers/media/i2c/st-mipid02.c
+++ b/drivers/media/i2c/st-mipid02.c
@@ -747,8 +747,8 @@ static int mipid02_parse_rx_ep(struct mipid02_dev *bridge)
 	of_node_put(ep_node);
 
 	if (IS_ERR(asd)) {
-		dev_err(&client->dev, "fail to register asd to notifier %ld",
-			PTR_ERR(asd));
+		dev_err(&client->dev, "fail to register asd to notifier %pe",
+			asd);
 		return PTR_ERR(asd);
 	}
 	bridge->notifier.ops = &mipid02_notifier_ops;

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 23/32] media: ipu6: isys: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:15 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./pci/intel/ipu6/ipu6-isys-csi2.c:91:22-29: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c
index d1fece6210ab25de4e8c7b5247f049cc1dd1e677..d858976112ba2bfc2907f9b88dc6c6434053f4a3 100644
--- a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c
+++ b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c
@@ -87,8 +87,8 @@ s64 ipu6_isys_csi2_get_link_freq(struct ipu6_isys_csi2 *csi2)
 	src_pad = media_entity_remote_source_pad_unique(&csi2->asd.sd.entity);
 	if (IS_ERR(src_pad)) {
 		dev_err(&csi2->isys->adev->auxdev.dev,
-			"can't get source pad of %s (%ld)\n",
-			csi2->asd.sd.name, PTR_ERR(src_pad));
+			"can't get source pad of %s (%pe)\n",
+			csi2->asd.sd.name, src_pad);
 		return PTR_ERR(src_pad);
 	}
 

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 21/32] media: ipu-bridge: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:15 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./pci/intel/ipu-bridge.c:567:3-10: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/pci/intel/ipu-bridge.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c
index 4e579352ab2c0be656576fa223429432940747d8..153b2f3685b447130b7ddfc2f971ffca8acd68aa 100644
--- a/drivers/media/pci/intel/ipu-bridge.c
+++ b/drivers/media/pci/intel/ipu-bridge.c
@@ -563,8 +563,8 @@ static void ipu_bridge_instantiate_vcm_work(struct work_struct *work)
 	vcm_client = i2c_acpi_new_device_by_fwnode(acpi_fwnode_handle(adev),
 						   1, &data->board_info);
 	if (IS_ERR(vcm_client)) {
-		dev_err(data->sensor, "Error instantiating VCM client: %ld\n",
-			PTR_ERR(vcm_client));
+		dev_err(data->sensor, "Error instantiating VCM client: %pe\n",
+			vcm_client);
 		goto out_pm_put;
 	}
 

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 19/32] media: rj54n1cb0c: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:14 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./i2c/rj54n1cb0c.c:1361:4-11: WARNING: Consider using %pe to print PTR_ERR()
./i2c/rj54n1cb0c.c:1370:4-11: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/i2c/rj54n1cb0c.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/i2c/rj54n1cb0c.c b/drivers/media/i2c/rj54n1cb0c.c
index 6dfc912168510fb1bd308f834911f9de705844b7..e95342d706c39a853e8c18de1ce447a5fa508565 100644
--- a/drivers/media/i2c/rj54n1cb0c.c
+++ b/drivers/media/i2c/rj54n1cb0c.c
@@ -1357,8 +1357,8 @@ static int rj54n1_probe(struct i2c_client *client)
 	rj54n1->pwup_gpio = gpiod_get_optional(&client->dev, "powerup",
 					       GPIOD_OUT_LOW);
 	if (IS_ERR(rj54n1->pwup_gpio)) {
-		dev_info(&client->dev, "Unable to get GPIO \"powerup\": %ld\n",
-			 PTR_ERR(rj54n1->pwup_gpio));
+		dev_info(&client->dev, "Unable to get GPIO \"powerup\": %pe\n",
+			 rj54n1->pwup_gpio);
 		ret = PTR_ERR(rj54n1->pwup_gpio);
 		goto err_clk_put;
 	}
@@ -1366,8 +1366,8 @@ static int rj54n1_probe(struct i2c_client *client)
 	rj54n1->enable_gpio = gpiod_get_optional(&client->dev, "enable",
 						 GPIOD_OUT_LOW);
 	if (IS_ERR(rj54n1->enable_gpio)) {
-		dev_info(&client->dev, "Unable to get GPIO \"enable\": %ld\n",
-			 PTR_ERR(rj54n1->enable_gpio));
+		dev_info(&client->dev, "Unable to get GPIO \"enable\": %pe\n",
+			 rj54n1->enable_gpio);
 		ret = PTR_ERR(rj54n1->enable_gpio);
 		goto err_gpio_put;
 	}

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 16/32] media: i2c: ov5675: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:14 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./i2c/ov5675.c:1188:9-16: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/i2c/ov5675.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/ov5675.c b/drivers/media/i2c/ov5675.c
index 30e27d39ee445c2603b8fecf7a1107969eb97df3..ea26df328189eef449ce121c0f62a4ef02631830 100644
--- a/drivers/media/i2c/ov5675.c
+++ b/drivers/media/i2c/ov5675.c
@@ -1184,8 +1184,8 @@ static int ov5675_get_hwcfg(struct ov5675 *ov5675)
 	ov5675->xvclk = devm_v4l2_sensor_clk_get(dev, NULL);
 	if (IS_ERR(ov5675->xvclk))
 		return dev_err_probe(dev, PTR_ERR(ov5675->xvclk),
-				     "failed to get xvclk: %ld\n",
-				     PTR_ERR(ov5675->xvclk));
+				     "failed to get xvclk: %pe\n",
+				     ov5675->xvclk);
 
 	xvclk_rate = clk_get_rate(ov5675->xvclk);
 	if (xvclk_rate != OV5675_XVCLK_19_2) {

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 17/32] media: i2c: ov5693: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:14 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./i2c/ov5693.c:1296:9-16: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/i2c/ov5693.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c
index d294477f9dd30704d2e43a0ed3e222aff3af365f..4cc796bbee9263c032384d8327961b5cee52b9e7 100644
--- a/drivers/media/i2c/ov5693.c
+++ b/drivers/media/i2c/ov5693.c
@@ -1292,8 +1292,8 @@ static int ov5693_probe(struct i2c_client *client)
 	ov5693->xvclk = devm_v4l2_sensor_clk_get(&client->dev, "xvclk");
 	if (IS_ERR(ov5693->xvclk))
 		return dev_err_probe(&client->dev, PTR_ERR(ov5693->xvclk),
-				     "failed to get xvclk: %ld\n",
-				     PTR_ERR(ov5693->xvclk));
+				     "failed to get xvclk: %pe\n",
+				     ov5693->xvclk);
 
 	xvclk_rate = clk_get_rate(ov5693->xvclk);
 	if (xvclk_rate != OV5693_XVCLK_FREQ)

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 18/32] media: i2c: ov9282: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:14 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./i2c/ov9282.c:1133:3-10: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/i2c/ov9282.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c
index a9f6176e9729d500a40004de92c35b9abf89b08c..3e24d88f603c1432865b4d880670e4b67f1b5cec 100644
--- a/drivers/media/i2c/ov9282.c
+++ b/drivers/media/i2c/ov9282.c
@@ -1129,8 +1129,8 @@ static int ov9282_parse_hw_config(struct ov9282 *ov9282)
 	ov9282->reset_gpio = devm_gpiod_get_optional(ov9282->dev, "reset",
 						     GPIOD_OUT_LOW);
 	if (IS_ERR(ov9282->reset_gpio)) {
-		dev_err(ov9282->dev, "failed to get reset gpio %ld",
-			PTR_ERR(ov9282->reset_gpio));
+		dev_err(ov9282->dev, "failed to get reset gpio %pe",
+			ov9282->reset_gpio);
 		return PTR_ERR(ov9282->reset_gpio);
 	}
 

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 15/32] media: i2c: mt9v111: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:14 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./i2c/mt9v111.c:1143:3-10: WARNING: Consider using %pe to print PTR_ERR()
./i2c/mt9v111.c:1151:3-10: WARNING: Consider using %pe to print PTR_ERR()
./i2c/mt9v111.c:1159:3-10: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/i2c/mt9v111.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/i2c/mt9v111.c b/drivers/media/i2c/mt9v111.c
index b4f2703faa1854a3a5e7d92ef312d01a39879a5a..64a758c95ab7b767de452304615a8d1f986dd23d 100644
--- a/drivers/media/i2c/mt9v111.c
+++ b/drivers/media/i2c/mt9v111.c
@@ -1139,24 +1139,24 @@ static int mt9v111_probe(struct i2c_client *client)
 	mt9v111->oe = devm_gpiod_get_optional(&client->dev, "enable",
 					      GPIOD_OUT_LOW);
 	if (IS_ERR(mt9v111->oe)) {
-		dev_err(&client->dev, "Unable to get GPIO \"enable\": %ld\n",
-			PTR_ERR(mt9v111->oe));
+		dev_err(&client->dev, "Unable to get GPIO \"enable\": %pe\n",
+			mt9v111->oe);
 		return PTR_ERR(mt9v111->oe);
 	}
 
 	mt9v111->standby = devm_gpiod_get_optional(&client->dev, "standby",
 						   GPIOD_OUT_HIGH);
 	if (IS_ERR(mt9v111->standby)) {
-		dev_err(&client->dev, "Unable to get GPIO \"standby\": %ld\n",
-			PTR_ERR(mt9v111->standby));
+		dev_err(&client->dev, "Unable to get GPIO \"standby\": %pe\n",
+			mt9v111->standby);
 		return PTR_ERR(mt9v111->standby);
 	}
 
 	mt9v111->reset = devm_gpiod_get_optional(&client->dev, "reset",
 						 GPIOD_OUT_LOW);
 	if (IS_ERR(mt9v111->reset)) {
-		dev_err(&client->dev, "Unable to get GPIO \"reset\": %ld\n",
-			PTR_ERR(mt9v111->reset));
+		dev_err(&client->dev, "Unable to get GPIO \"reset\": %pe\n",
+			mt9v111->reset);
 		return PTR_ERR(mt9v111->reset);
 	}
 

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related

* [PATCH 12/32] media: i2c: max9286: Use %pe format specifier
From: Ricardo Ribalda @ 2025-10-13 14:14 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, Mauro Carvalho Chehab,
	Hans Verkuil, Sakari Ailus, Krzysztof Hałasa, Tomi Valkeinen,
	Leon Luo, Kieran Bingham, Jacopo Mondi, Kieran Bingham,
	Laurent Pinchart, Niklas Söderlund, Julien Massot,
	Jacopo Mondi, Daniel Scally, Dave Stevenson, Benjamin Mugnier,
	Sylvain Petinot, Yong Zhi, Bingbu Cao, Tianshu Qiu, Tiffany Lin,
	Andrew-CT Chen, Yunfei Dong, Matthias Brugger,
	AngeloGioacchino Del Regno, Rui Miguel Silva, Laurent Pinchart,
	Martin Kepplinger, Purism Kernel Team, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dafna Hirschfeld,
	Heiko Stuebner, Sylwester Nawrocki, Krzysztof Kozlowski,
	Alim Akhtar, Yemike Abhilash Chandra, Greg Kroah-Hartman
  Cc: linux-input, linux-kernel, linux-media, linux-arm-kernel,
	linux-mediatek, imx, linux-renesas-soc, linux-rockchip,
	linux-samsung-soc, linux-staging, Ricardo Ribalda
In-Reply-To: <20251013-ptr_err-v1-0-2c5efbd82952@chromium.org>

The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./i2c/max9286.c:755:7-14: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/i2c/max9286.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index 7c0961688d6173843f3ae846253d4a8669ae762b..e6e214f8294b83105be02f29966e1d3ed72f8dbe 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -751,8 +751,8 @@ static int max9286_v4l2_notifier_register(struct max9286_priv *priv)
 		mas = v4l2_async_nf_add_fwnode(&priv->notifier, source->fwnode,
 					       struct max9286_asd);
 		if (IS_ERR(mas)) {
-			dev_err(dev, "Failed to add subdev for source %u: %ld",
-				i, PTR_ERR(mas));
+			dev_err(dev, "Failed to add subdev for source %u: %pe",
+				i, mas);
 			v4l2_async_nf_cleanup(&priv->notifier);
 			return PTR_ERR(mas);
 		}

-- 
2.51.0.760.g7b8bcc2412-goog


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox