media: Use %pe format specifier
Subsystems (36)
cover media: Use %pe format specifier
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().
The recently introduced test scripts/coccinelle/misc/ptr_err_to_pe.cocci checks that we use %pe. Let's make it happy.
---
Ricardo Ribalda (32):
Input: cyttsp5 - Use %pe format specifier
media: dvbdev: Use %pe format specifier
media: mn88443x: Use %pe format specifier
media: adv7842: Use %pe format specifier
media: ar0521: Use %pe format specifier
media: ccs: Use %pe format specifier
media: i2c: ds90ub913: Use %pe format specifier
media: i2c: ds90ub953: Use %pe format specifier
media: i2c: imx274: Use %pe format specifier
media: i2c: imx335: Use %pe format specifier
media: i2c: imx412: Use %pe format specifier
media: i2c: max9286: Use %pe format specifier
media: i2c: max96717: Use %pe format specifier
media: i2c: mt9m111: Use %pe format specifier
media: i2c: mt9v111: Use %pe format specifier
media: i2c: ov5675: Use %pe format specifier
media: i2c: ov5693: Use %pe format specifier
media: i2c: ov9282: Use %pe format specifier
media: rj54n1cb0c: Use %pe format specifier
media: i2c: st-mipid02: Use %pe format specifier
media: ipu-bridge: Use %pe format specifier
media: ipu3-cio2: Use %pe format specifier
media: ipu6: isys: Use %pe format specifier
media: mediatek: vcodec: Use %pe format specifier
media: imx8mq-mipi-csi2: Use %pe format specifier
media: platform: rzg2l-cru: Use %pe format specifier
media: renesas: vsp1: Use %pe format specifier
media: rkisp1: Use %pe format specifier
media: samsung: exynos4-is: Use %pe format specifier
media: ti: cal Use %pe format specifier
media: staging: ipu3-imgu: Use %pe format specifier
media: staging/ipu7: Use %pe format specifier
drivers/input/touchscreen/cyttsp5.c | 4 ++-- drivers/media/dvb-core/dvbdev.c | 4 ++-- drivers/media/dvb-frontends/mn88443x.c | 7 +++---- drivers/media/i2c/adv7842.c | 4 ++-- drivers/media/i2c/ar0521.c | 4 ++-- drivers/media/i2c/ccs/ccs-core.c | 8 ++++---- drivers/media/i2c/ds90ub913.c | 2 +- drivers/media/i2c/ds90ub953.c | 2 +- drivers/media/i2c/imx274.c | 3 +-- drivers/media/i2c/imx335.c | 4 ++-- drivers/media/i2c/imx412.c | 4 ++-- drivers/media/i2c/max9286.c | 4 ++-- drivers/media/i2c/max96717.c | 2 +- drivers/media/i2c/mt9m111.c | 4 ++-- drivers/media/i2c/mt9v111.c | 12 ++++++------ drivers/media/i2c/ov5675.c | 4 ++-- drivers/media/i2c/ov5693.c | 4 ++-- drivers/media/i2c/ov9282.c | 4 ++-- drivers/media/i2c/rj54n1cb0c.c | 8 ++++---- drivers/media/i2c/st-mipid02.c | 4 ++-- drivers/media/pci/intel/ipu-bridge.c | 4 ++-- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 4 ++-- drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c | 4 ++-- .../media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c | 4 ++-- drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 4 ++-- drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c | 8 ++++---- drivers/media/platform/renesas/vsp1/vsp1_drv.c | 3 +-- drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c | 4 ++-- drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 4 ++-- drivers/media/platform/samsung/exynos4-is/media-dev.c | 4 ++-- drivers/media/platform/ti/cal/cal.c | 3 +-- drivers/staging/media/ipu3/ipu3.c | 3 +-- drivers/staging/media/ipu7/ipu7-isys-csi-phy.c | 4 ++-- drivers/staging/media/ipu7/ipu7-isys-csi2.c | 4 ++-- 34 files changed, 72 insertions(+), 77 deletions(-)
---
base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787
change-id: 20251013-ptr_err-9a7968fcd19f
Best regards,
Signature · 1 line
Ricardo Ribalda <[email protected]>
PATCH 1/32 Input: cyttsp5 - Use %pe format specifier
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()
--- drivers/input/touchscreen/cyttsp5.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/input/touchscreen/cyttsp5.c +2 -2
@@ -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); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
Frank Li
maintainerRe: [PATCH 01/32] Input: cyttsp5 - Use %pe format specifier
Quoted 11 lines · Ricardo Ribalda
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 omittingPTR_ERR()This patch fixes this cocci report:
./cyttsp5.c:927:3-10: WARNING: Consider using %pe to printPTR_ERR()Signed-off-by Ricardo Ribalda <[email protected]>--- 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
Quoted 20 lines
drivers/input/touchscreen/cyttsp5.c +2
-3@@ -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
Re: [PATCH 01/32] Input: cyttsp5 - Use %pe format specifier
Hi Frank
Quoted 9 lines · Frank Li
Quoted 7 lines · Ricardo Ribalda
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 omittingPTR_ERR()This patch fixes this cocci report:
./cyttsp5.c:927:3-10: WARNING: Consider using %pe to printPTR_ERR()
Quoted 7 lines
Quoted 4 lines
Signed-off-by Ricardo Ribalda <[email protected]>--- 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?
Indeed, it belongs to input. if there is a v2 I will move it to a different thread.
Thanks!
Quoted 23 lines
Frank
Quoted 20 lines
drivers/input/touchscreen/cyttsp5.c +2
-3@@ -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
Signature · 1 line
Ricardo Ribalda
Re: [PATCH 01/32] Input: cyttsp5 - Use %pe format specifier
In reply to Ricardo RibaldaQuoted 8 lines · Ricardo Ribalda
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 omittingPTR_ERR()This patch fixes this cocci report:
./cyttsp5.c:927:3-10: WARNING: Consider using %pe to printPTR_ERR()Signed-off-by Ricardo Ribalda <[email protected]>
Applied, thank you.
Signature · 1 line
Dmitry
PATCH 2/32 media: dvbdev: Use %pe format specifier
In reply to Ricardo RibaldaThe %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:
./dvb-core/dvbdev.c:575:48-55: WARNING: Consider using %pe to print PTR_ERR()
--- drivers/media/dvb-core/dvbdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/dvb-core/dvbdev.c +2 -2
@@ -571,8 +571,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,MKDEV (DVB_MAJOR , minor), dvbdev, "dvb%d.%s%d", adap->num, dnames[type], id);if (IS_ERR (clsdev)) { -pr_err ("%s: failed to create device dvb%d.%s%d (%ld)\n" , - __func__, adap->num, dnames[type], id,PTR_ERR (clsdev)); +pr_err ("%s: failed to create device dvb%d.%s%d (%pe)\n" , + __func__, adap->num, dnames[type], id, clsdev);if (new_node) {list_del (&new_node->list_head);kfree (dvbdevfops);
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 3/32 media: mn88443x: Use %pe format specifier
In reply to Ricardo RibaldaThe %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:
./dvb-frontends/mn88443x.c:698:3-10: WARNING: Consider using %pe to print PTR_ERR() ./dvb-frontends/mn88443x.c:713:3-10: WARNING: Consider using %pe to print PTR_ERR()
--- drivers/media/dvb-frontends/mn88443x.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/media/dvb-frontends/mn88443x.c +3 -4
@@ -694,8 +694,7 @@ static int mn88443x_probe(struct i2c_client *client) chip->mclk =devm_clk_get (dev,"mclk" );if (IS_ERR (chip->mclk) && !conf) { -dev_err (dev,"Failed to request mclk: %ld\n" , -PTR_ERR (chip->mclk)); +dev_err (dev,"Failed to request mclk: %pe\n" , chip->mclk);return PTR_ERR (chip->mclk); }
@@ -709,8 +708,8 @@ static int mn88443x_probe(struct i2c_client *client) chip->reset_gpio =devm_gpiod_get_optional (dev,"reset" ,GPIOD_OUT_HIGH );if (IS_ERR (chip->reset_gpio)) { -dev_err (dev,"Failed to request reset_gpio: %ld\n" , -PTR_ERR (chip->reset_gpio)); +dev_err (dev,"Failed to request reset_gpio: %pe\n" , + chip->reset_gpio);return PTR_ERR (chip->reset_gpio); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 4/32 media: adv7842: Use %pe format specifier
In reply to Ricardo RibaldaThe %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/adv7842.c:3470:16-23: WARNING: Consider using %pe to print PTR_ERR()
--- drivers/media/i2c/adv7842.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/adv7842.c +2 -2
@@ -3466,8 +3466,8 @@ static struct i2c_client *adv7842_dummy_client(struct v4l2_subdev *sd, const cha cp =i2c_new_dummy_device (client->adapter,io_read (sd, io_reg) >>1 );if (IS_ERR (cp)) { -v4l2_err (sd,"register %s on i2c addr 0x%x failed with %ld\n" , - desc, addr,PTR_ERR (cp)); +v4l2_err (sd,"register %s on i2c addr 0x%x failed with %pe\n" , + desc, addr, cp); cp =NULL ; }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 5/32 media: ar0521: Use %pe format specifier
In reply to Ricardo RibaldaThe %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/ar0521.c:1113:31-38: WARNING: Consider using %pe to print PTR_ERR()
--- drivers/media/i2c/ar0521.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ar0521.c +2 -2
@@ -1109,8 +1109,8 @@ static int ar0521_probe(struct i2c_client *client) ar0521_supply_names[cnt]);if (IS_ERR (supply)) { -dev_info (dev,"no %s regulator found: %li\n" , - ar0521_supply_names[cnt],PTR_ERR (supply)); +dev_info (dev,"no %s regulator found: %pe\n" , + ar0521_supply_names[cnt], supply);return PTR_ERR (supply); } sensor->supplies[cnt] = supply;
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
Re: [PATCH 05/32] media: ar0521: Use %pe format specifier
Quoted 8 lines · Ricardo Ribalda
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 omittingPTR_ERR()This patch fixes this cocci report:
./i2c/ar0521.c:1113:31-38: WARNING: Consider using %pe to printPTR_ERR()Signed-off-by Ricardo Ribalda <[email protected]>
Thanks,
Quoted 13 lines
drivers/media/i2c/ar0521.c +2
-2@@ -1109,8 +1109,8 @@ static int ar0521_probe(struct i2c_client *client) ar0521_supply_names[cnt]);if (IS_ERR (supply)) { -dev_info (dev,"no %s regulator found: %li\n" , - ar0521_supply_names[cnt],PTR_ERR (supply)); +dev_info (dev,"no %s regulator found: %pe\n" , + ar0521_supply_names[cnt], supply);return PTR_ERR (supply); } sensor->supplies[cnt] = supply;
Signature · 5 lines
Krzysztof "Chris" Hałasa Sieć Badawcza Łukasiewicz Przemysłowy Instytut Automatyki i Pomiarów PIAP Al. Jerozolimskie 202, 02-486 Warszawa
PATCH 6/32 media: ccs: Use %pe format specifier
In reply to Ricardo RibaldaThe %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/ccs/ccs-core.c:3241:3-10: WARNING: Consider using %pe to print PTR_ERR() ./i2c/ccs/ccs-core.c:3298:3-10: WARNING: Consider using %pe to print PTR_ERR()
--- drivers/media/i2c/ccs/ccs-core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/i2c/ccs/ccs-core.c +4 -4
@@ -3237,8 +3237,8 @@ static int ccs_probe(struct i2c_client *client)dev_info (&client->dev,"no clock defined, continuing...\n" ); sensor->ext_clk =NULL ; }else if (IS_ERR (sensor->ext_clk)) { -dev_err (&client->dev,"could not get clock (%ld)\n" , -PTR_ERR (sensor->ext_clk)); +dev_err (&client->dev,"could not get clock (%pe)\n" , + sensor->ext_clk);return -EPROBE_DEFER ; }
@@ -3294,8 +3294,8 @@ static int ccs_probe(struct i2c_client *client) sensor->regmap =devm_cci_regmap_init_i2c (client,16 );if (IS_ERR (sensor->regmap)) { -dev_err (&client->dev,"can't initialise CCI (%ld)\n" , -PTR_ERR (sensor->regmap)); +dev_err (&client->dev,"can't initialise CCI (%pe)\n" , + sensor->regmap);return PTR_ERR (sensor->regmap); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 7/32 media: i2c: ds90ub913: Use %pe format specifier
In reply to Ricardo RibaldaThe %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/ds90ub913.c:625:44-51: WARNING: Consider using %pe to print PTR_ERR()
--- drivers/media/i2c/ds90ub913.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ds90ub913.c +1 -1
@@ -622,7 +622,7 @@ static int ub913_v4l2_notifier_register(struct ub913_data *priv)fwnode_handle_put (ep_fwnode);if (IS_ERR (asd)) { -dev_err (dev,"Failed to add subdev: %ld" ,PTR_ERR (asd)); +dev_err (dev,"Failed to add subdev: %pe" , asd);v4l2_async_nf_cleanup (&priv->notifier);return PTR_ERR (asd); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 8/32 media: i2c: ds90ub953: Use %pe format specifier
In reply to Ricardo RibaldaThe %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/ds90ub953.c:779:44-51: WARNING: Consider using %pe to print PTR_ERR()
--- drivers/media/i2c/ds90ub953.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ds90ub953.c +1 -1
@@ -776,7 +776,7 @@ static int ub953_v4l2_notifier_register(struct ub953_data *priv)fwnode_handle_put (ep_fwnode);if (IS_ERR (asd)) { -dev_err (dev,"Failed to add subdev: %ld" ,PTR_ERR (asd)); +dev_err (dev,"Failed to add subdev: %pe" , asd);v4l2_async_nf_cleanup (&priv->notifier);return PTR_ERR (asd); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 9/32 media: i2c: imx274: Use %pe format specifier
In reply to Ricardo RibaldaThe %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/imx274.c:2038:32-39: WARNING: Consider using %pe to print PTR_ERR()
--- drivers/media/i2c/imx274.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/i2c/imx274.c +1 -2
@@ -2034,8 +2034,7 @@ static int imx274_probe(struct i2c_client *client)/* initialize regmap */ imx274->regmap =devm_regmap_init_i2c (client, &imx274_regmap_config);if (IS_ERR (imx274->regmap)) { -dev_err (dev, -"regmap init failed: %ld\n" ,PTR_ERR (imx274->regmap)); +dev_err (dev,"regmap init failed: %pe\n" , imx274->regmap); ret = -ENODEV ; goto err_regmap; }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 10/32 media: i2c: imx335: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/i2c/imx335.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/imx335.c +2 -2
@@ -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);return PTR_ERR (imx335->reset_gpio); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
Re: [PATCH 10/32] media: i2c: imx335: Use %pe format specifier
Quoting Ricardo Ribalda (2025-10-13 15:14:50)
Quoted 6 lines
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 omittingPTR_ERR().This patch fixes this cocci report:
./i2c/imx335.c:1013:3-10: WARNING: Consider using %pe to printPTR_ERR()
Ohhh nice. Is this new ? First I've come across it.
Quoted 10 lines
Signed-off-by Ricardo Ribalda <[email protected]>--- drivers/media/i2c/imx335.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/media/i2c/imx335.c +0
-0
drivers/media/i2c/imx335.c static int imx335_parse_hw_config(struct imx335 *imx335) · line 1013
Quoted 7 lines
drivers/media/i2c/imx335.c +2
-2@@ -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);
Quoted 7 lines
drivers/media/i2c/imx335.c +0
-0return PTR_ERR (imx335->reset_gpio); }Signature · 2 lines
-- 2.51.0.760.g7b8bcc2412-goog
Kieran Bingham
maintainerRe: [PATCH 10/32] media: i2c: imx335: Use %pe format specifier
Quoting Kieran Bingham (2025-10-13 16:03:23)
Quoted 17 lines
Quoting Ricardo Ribalda (2025-10-13 15:14:50)
Quoted 6 lines
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 omittingPTR_ERR().This patch fixes this cocci report:
./i2c/imx335.c:1013:3-10: WARNING: Consider using %pe to printPTR_ERR()Ohhh nice. Is this new ? First I've come across it.
Quoted 5 lines
Signed-off-by Ricardo Ribalda <[email protected]>--- drivers/media/i2c/imx335.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 15 lines
drivers/media/i2c/imx335.c static int imx335_parse_hw_config(struct imx335 *imx335) · line 1013
Quoted 12 lines
drivers/media/i2c/imx335.c +2
-2@@ -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 <[email protected]>
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.
Quoted 7 lines
Quoted 7 lines
drivers/media/i2c/imx335.c +0
-0return PTR_ERR (imx335->reset_gpio); }Signature · 2 lines
-- 2.51.0.760.g7b8bcc2412-goog
Re: [PATCH 10/32] media: i2c: imx335: Use %pe format specifier
In reply to Kieran BinghamHi Kieran
Quoted 10 lines · Kieran Bingham
Quoting Ricardo Ribalda (2025-10-13 15:14:50)
Quoted 6 lines
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 omittingPTR_ERR().This patch fixes this cocci report:
./i2c/imx335.c:1013:3-10: WARNING: Consider using %pe to printPTR_ERR()Ohhh nice. Is this new ? First I've come across it.
It is actually from 2019:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=57f5677e535ba24b8926a7125be2ef8d7f09323c
I just learned about it because there is a new check in coccinelle :).
It is pretty cool, but you need to be careful to check IS_ERR(ptr) before doing the printk, otherwise %pe will print the pointer value.
Regards!
Quoted 30 lines
Quoted 13 lines
Signed-off-by Ricardo Ribalda <[email protected]>--- drivers/media/i2c/imx335.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/media/i2c/imx335.c +0
-0drivers/media/i2c/imx335.c static int imx335_parse_hw_config(struct imx335 *imx335) · line 1013
Quoted 7 lines
drivers/media/i2c/imx335.c +2
-2@@ -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 <[email protected]>Quoted 7 lines
drivers/media/i2c/imx335.c +0
-1return PTR_ERR (imx335->reset_gpio); } --2.51.0.760.g7b8bcc2412-goog
Signature · 1 line
Ricardo Ribalda
PATCH 11/32 media: i2c: imx412: Use %pe format specifier
In reply to Ricardo RibaldaThe %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/imx412.c:931:3-10: WARNING: Consider using %pe to print PTR_ERR()
--- drivers/media/i2c/imx412.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/imx412.c +2 -2
@@ -927,8 +927,8 @@ static int imx412_parse_hw_config(struct imx412 *imx412) imx412->reset_gpio =devm_gpiod_get_optional (imx412->dev,"reset" ,GPIOD_OUT_LOW );if (IS_ERR (imx412->reset_gpio)) { -dev_err (imx412->dev,"failed to get reset gpio %ld\n" , -PTR_ERR (imx412->reset_gpio)); +dev_err (imx412->dev,"failed to get reset gpio %pe\n" , + imx412->reset_gpio);return PTR_ERR (imx412->reset_gpio); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
Re: [PATCH 11/32] media: i2c: imx412: Use %pe format specifier
Quoted 29 lines · Ricardo Ribalda
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 omittingPTR_ERR().This patch fixes this cocci report:
./i2c/imx412.c:931:3-10: WARNING: Consider using %pe to printPTR_ERR()Signed-off-by Ricardo Ribalda <[email protected]>--- drivers/media/i2c/imx412.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/media/i2c/imx412.c +2
-3@@ -927,8 +927,8 @@ static int imx412_parse_hw_config(struct imx412 *imx412) imx412->reset_gpio =devm_gpiod_get_optional (imx412->dev,"reset" ,GPIOD_OUT_LOW );if (IS_ERR (imx412->reset_gpio)) { -dev_err (imx412->dev,"failed to get reset gpio %ld\n" , -PTR_ERR (imx412->reset_gpio)); +dev_err (imx412->dev,"failed to get reset gpio %pe\n" , + imx412->reset_gpio);return PTR_ERR (imx412->reset_gpio); } --
Quoted 3 lines
2.51.0.760.g7b8bcc2412-goog
PATCH 12/32 media: i2c: max9286: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/i2c/max9286.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/max9286.c +2 -2
@@ -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); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
Re: [PATCH 12/32] media: i2c: max9286: Use %pe format specifier
Quoting Ricardo Ribalda (2025-10-13 15:14:52)
Quoted 17 lines
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 omittingPTR_ERR().This patch fixes this cocci report:
./i2c/max9286.c:755:7-14: WARNING: Consider using %pe to printPTR_ERR()Signed-off-by Ricardo Ribalda <[email protected]>--- drivers/media/i2c/max9286.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/media/i2c/max9286.c +0
-0
drivers/media/i2c/max9286.c static int max9286_v4l2_notifier_register(struct max9286_priv *priv) · line 755
Quoted 7 lines
drivers/media/i2c/max9286.c +2
-2@@ -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);
Quoted 12 lines
drivers/media/i2c/max9286.c +0
-0v4l2_async_nf_cleanup (&priv->notifier);return PTR_ERR (mas); }Signature · 8 lines
-- 2.51.0.760.g7b8bcc2412-goog _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip
PATCH 13/32 media: i2c: max96717: Use %pe format specifier
In reply to Ricardo RibaldaThe %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/max96717.c:653:44-51: WARNING: Consider using %pe to print PTR_ERR()
--- drivers/media/i2c/max96717.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/max96717.c +1 -1
@@ -650,7 +650,7 @@ static int max96717_v4l2_notifier_register(struct max96717_priv *priv)fwnode_handle_put (ep_fwnode);if (IS_ERR (asd)) { -dev_err (dev,"Failed to add subdev: %ld" ,PTR_ERR (asd)); +dev_err (dev,"Failed to add subdev: %pe" , asd);v4l2_async_nf_cleanup (&priv->notifier);return PTR_ERR (asd); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 14/32 media: i2c: mt9m111: Use %pe format specifier
In reply to Ricardo RibaldaThe %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/mt9m111.c:1290:3-10: WARNING: Consider using %pe to print PTR_ERR()
--- drivers/media/i2c/mt9m111.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/mt9m111.c +2 -2
@@ -1286,8 +1286,8 @@ static int mt9m111_probe(struct i2c_client *client) mt9m111->regulator =devm_regulator_get (&client->dev,"vdd" );if (IS_ERR (mt9m111->regulator)) { -dev_err (&client->dev,"regulator not found: %ld\n" , -PTR_ERR (mt9m111->regulator)); +dev_err (&client->dev,"regulator not found: %pe\n" , + mt9m111->regulator);return PTR_ERR (mt9m111->regulator); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 15/32 media: i2c: mt9v111: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/i2c/mt9v111.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/media/i2c/mt9v111.c +6 -6
@@ -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); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 16/32 media: i2c: ov5675: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/i2c/ov5675.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov5675.c +2 -2
@@ -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 ) {
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
Re: [PATCH 16/32] media: i2c: ov5675: Use %pe format specifier
Quoted 29 lines · Ricardo Ribalda
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 omittingPTR_ERR().This patch fixes this cocci report:
./i2c/ov5675.c:1188:9-16: WARNING: Consider using %pe to printPTR_ERR()Signed-off-by Ricardo Ribalda <[email protected]>--- drivers/media/i2c/ov5675.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/media/i2c/ov5675.c +2
-3@@ -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 ) { --
Quoted 3 lines
2.51.0.760.g7b8bcc2412-goog
PATCH 17/32 media: i2c: ov5693: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/i2c/ov5693.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov5693.c +2 -2
@@ -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 )
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 18/32 media: i2c: ov9282: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/i2c/ov9282.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov9282.c +2 -2
@@ -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); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
Re: [PATCH 18/32] media: i2c: ov9282: Use %pe format specifier
Quoted 29 lines · Ricardo Ribalda
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 omittingPTR_ERR().This patch fixes this cocci report:
./i2c/ov9282.c:1133:3-10: WARNING: Consider using %pe to printPTR_ERR()Signed-off-by Ricardo Ribalda <[email protected]>--- drivers/media/i2c/ov9282.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/media/i2c/ov9282.c +2
-3@@ -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); } --
Quoted 3 lines
2.51.0.760.g7b8bcc2412-goog
PATCH 19/32 media: rj54n1cb0c: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/i2c/rj54n1cb0c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/i2c/rj54n1cb0c.c +4 -4
@@ -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; }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 20/32 media: i2c: st-mipid02: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/i2c/st-mipid02.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/st-mipid02.c +2 -2
@@ -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;
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 21/32 media: ipu-bridge: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/pci/intel/ipu-bridge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/pci/intel/ipu-bridge.c +2 -2
@@ -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; }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 22/32 media: ipu3-cio2: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/pci/intel/ipu3/ipu3-cio2.c +2 -2
@@ -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); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 23/32 media: ipu6: isys: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c +2 -2
@@ -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); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 24/32 media: mediatek: vcodec: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c +2 -2
@@ -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);
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
Re: [PATCH 24/32] media: mediatek: vcodec: Use %pe format specifier
Il 13/10/25 16:15, Ricardo Ribalda ha scritto:
Quoted 8 lines
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 omittingPTR_ERR().This patch fixes this cocci report:
./platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c:187:3-10: WARNING: Consider using %pe to printPTR_ERR()Signed-off-by Ricardo Ribalda <[email protected]>
PATCH 25/32 media: imx8mq-mipi-csi2: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/nxp/imx8mq-mipi-csi2.c +2 -2
@@ -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); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
Re: [PATCH 25/32] media: imx8mq-mipi-csi2: Use %pe format specifier
Am Montag, dem 13.10.2025 um 14:15 +0000 schrieb Ricardo Ribalda:
Quoted 33 lines
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 omittingPTR_ERR().This patch fixes this cocci report:
./platform/nxp/imx8mq-mipi-csi2.c:422:23-30: WARNING: Consider using %pe to printPTR_ERR()Signed-off-by Ricardo Ribalda <[email protected]>---
drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)drivers/media/platform/nxp/imx8mq-mipi-csi2.c +0
-0index
3a4645f59a44028fdca82a4d8393e1a0a6ba88f0..d333ff43539f061b8b9cf88af2cda8c44b3ec2a9100644drivers/media/platform/nxp/imx8mq-mipi-csi2.c +0
-0@@ -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-Quoted 1 line
sd->entity);if (
IS_ERR(src_pad)) {drivers/media/platform/nxp/imx8mq-mipi-csi2.c +0
-1- dev_err(state->dev, "can't get source pad of %s(%ld)\n",
drivers/media/platform/nxp/imx8mq-mipi-csi2.c +1
-1- sd_state->sd->name, PTR_ERR(src_pad)); + dev_err(state->dev, "can't get source pad of %s(%pe)\n",
drivers/media/platform/nxp/imx8mq-mipi-csi2.c +1
-0+ sd_state->sd->name, src_pad);
Quoted 3 lines
return
PTR_ERR(src_pad);
}
thanks you,
martin
PATCH 26/32 media: platform: rzg2l-cru: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c +4 -4
@@ -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,
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 27/32 media: renesas: vsp1: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/platform/renesas/vsp1/vsp1_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/platform/renesas/vsp1/vsp1_drv.c +1 -2
@@ -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); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
Re: [PATCH 27/32] media: renesas: vsp1: Use %pe format specifier
Quoted 8 lines · Ricardo Ribalda
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 omittingPTR_ERR().This patch fixes this cocci report:
./platform/renesas/vsp1/vsp1_drv.c:958:4-11: WARNING: Consider using %pe to printPTR_ERR()Signed-off-by Ricardo Ribalda <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
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
PATCH 28/32 media: rkisp1: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- 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(-)
drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c +2 -2
@@ -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 ; }
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c +2 -2
@@ -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 ; }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 29/32 media: samsung: exynos4-is: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/platform/samsung/exynos4-is/media-dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/samsung/exynos4-is/media-dev.c +2 -2
@@ -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; }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 30/32 media: ti: cal Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/media/platform/ti/cal/cal.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/platform/ti/cal/cal.c +1 -2
@@ -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
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 31/32 media: staging: ipu3-imgu: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- drivers/staging/media/ipu3/ipu3.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/media/ipu3/ipu3.c +1 -2
@@ -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 ; }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
PATCH 32/32 media: staging/ipu7: Use %pe format specifier
In reply to Ricardo RibaldaThe %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()
--- 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(-)
drivers/staging/media/ipu7/ipu7-isys-csi-phy.c +2 -2
@@ -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); }
drivers/staging/media/ipu7/ipu7-isys-csi2.c +2 -2
@@ -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); }
Signature · 1 line
2.51.0.760.g7b8bcc2412-goog
Hi Ricardo,
Quoted 8 lines · Ricardo Ribalda
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 omittingPTR_ERR().The recently introduced test
scripts/coccinelle/misc/ptr_err_to_pe.coccichecks that we use %pe. Let's make it happy.Signed-off-by Ricardo Ribalda <[email protected]>
Thanks for the set.
Signature · 3 lines
Kind regards, Sakari Ailus