drivers/i2c/busses/i2c-nvidia-gpu.c:284:1-3: WARNING: PTR_ERR_OR_ZERO can be used
kbuild test robot
build bottree: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/i2c/new_dummy head: b401cd1e73e824b8e1231b97c36b7fa21017b669 commit: b401cd1e73e824b8e1231b97c36b7fa21017b669 [5/5] plain
If you fix the issue, kindly add following tag
Reported-by kbuild test robot <[email protected]>
coccinelle warnings: (new ones prefixed by >>)
>> drivers/i2c/busses/i2c-nvidia-gpu.c:284:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Please review and possibly fold the followup patch.
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
kbuild test robot
build bot[PATCH] fix ptr_ret.cocci warnings
drivers/i2c/busses/i2c-nvidia-gpu.c:284:1-3: WARNING: PTR_ERR_OR_ZERO can be used
From: kbuild test robot <[email protected]>
drivers/i2c/busses/i2c-nvidia-gpu.c:284:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
Generated by: scripts/coccinelle/api/ptr_ret.cocci
Fixes b401cd1e73e8 ("plain")
Signed-off-by kbuild test robot <[email protected]>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/i2c/new_dummy head: b401cd1e73e824b8e1231b97c36b7fa21017b669 commit: b401cd1e73e824b8e1231b97c36b7fa21017b669 [5/5] plain
i2c-nvidia-gpu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/i2c/busses/i2c-nvidia-gpu.c +1 -4
@@ -281,10 +281,7 @@ static int gpu_populate_client(struct gp i2cd->gpu_ccgx_ucsi->irq = irq; i2cd->gpu_ccgx_ucsi->properties = ccgx_props; i2cd->ccgx_client =i2c_new_client_device (&i2cd->adapter, i2cd->gpu_ccgx_ucsi); -if (IS_ERR (i2cd->ccgx_client)) -return PTR_ERR (i2cd->ccgx_client); - -return 0 ; +return PTR_ERR_OR_ZERO (i2cd->ccgx_client); }static int gpu_i2c_probe (struct pci_dev *pdev,const struct pci_device_id *id)