Skip to content

Commit

Permalink
mm/page_owner.c: use PTR_ERR_OR_ZERO()
Browse files Browse the repository at this point in the history
Fix ptr_ret.cocci warnings:

  mm/page_owner.c:639: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

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Vasyl Gomonovych <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Carmichael561 authored and torvalds committed Feb 1, 2018
1 parent a983b5e commit 8e33771
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mm/page_owner.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,7 @@ static int __init pageowner_init(void)

dentry = debugfs_create_file("page_owner", S_IRUSR, NULL,
NULL, &proc_page_owner_operations);
if (IS_ERR(dentry))
return PTR_ERR(dentry);

return 0;
return PTR_ERR_OR_ZERO(dentry);
}
late_initcall(pageowner_init)

0 comments on commit 8e33771

Please sign in to comment.