PNP: pnpbios: Use PTR_ERR_OR_ZERO()
PATCH 1/1 PNP: pnpbios: Use PTR_ERR_OR_ZERO()
Fix ptr_ret.cocci warnings:
drivers/pnp/pnpbios/core.c:584: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
--- drivers/pnp/pnpbios/core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/pnp/pnpbios/core.c +1 -4
@@ -581,10 +581,7 @@ static int __init pnpbios_thread_init(void)init_completion (&unload_sem); task =kthread_run (pnp_dock_thread,NULL ,"kpnpbiosd" ); -if (IS_ERR (task)) -return PTR_ERR (task); - -return 0 ; +return PTR_ERR_OR_ZERO (task); }/* Start the kernel thread later: */
Signature · 1 line
1.9.1
Quoted 18 lines · Vasyl Gomonovych
Fix
ptr_ret.cocciwarnings:
drivers/pnp/pnpbios/core.c:584:1-3: WARNING:PTR_ERR_OR_ZEROcan be usedUse
PTR_ERR_OR_ZEROrather than if(IS_ERR(...)) +PTR_ERRGenerated by:
scripts/coccinelle/api/ptr_ret.cocciSigned-off-by Vasyl Gomonovych <[email protected]>--- drivers/pnp/pnpbios/core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/pnp/pnpbios/core.c +0
-0@@ -581,10 +581,7 @@ static int __init pnpbios_thread_init(void)
drivers/pnp/pnpbios/core.c static int __init pnpbios_thread_init(void) · line 587
Quoted 10 lines
drivers/pnp/pnpbios/core.c +1
-4init_completion (&unload_sem); task =kthread_run (pnp_dock_thread,NULL ,"kpnpbiosd" ); -if (IS_ERR (task)) -return PTR_ERR (task); - -return 0 ; +return PTR_ERR_OR_ZERO (task); }/* Start the kernel thread later: */
Looks good to me.
Signature · 2 lines
Jean Delvare SUSE L3 Support
Rafael J. Wysocki
AppliedQuoted 28 lines · CET Jean Delvare
Quoted 27 lines · Vasyl Gomonovych
Fix
ptr_ret.cocciwarnings:
drivers/pnp/pnpbios/core.c:584:1-3: WARNING:PTR_ERR_OR_ZEROcan be usedUse
PTR_ERR_OR_ZEROrather than if(IS_ERR(...)) +PTR_ERRGenerated by:
scripts/coccinelle/api/ptr_ret.cocciSigned-off-by Vasyl Gomonovych <[email protected]>--- drivers/pnp/pnpbios/core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/pnp/pnpbios/core.c +1
-4@@ -581,10 +581,7 @@ static int __init pnpbios_thread_init(void)init_completion (&unload_sem); task =kthread_run (pnp_dock_thread,NULL ,"kpnpbiosd" ); -if (IS_ERR (task)) -return PTR_ERR (task); - -return 0 ; +return PTR_ERR_OR_ZERO (task); }
Quoted 7 lines
drivers/pnp/pnpbios/core.c static int __init pnpbios_thread_init(void) · line 587
Quoted 1 line
drivers/pnp/pnpbios/core.c +0
-0/* Start the kernel thread later: */ Looks good to me.
Reviewed-by Jean Delvare <[email protected]>
Applied, thanks!