From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f200.google.com (mail-wr0-f200.google.com [209.85.128.200]) by kanga.kvack.org (Postfix) with ESMTP id AEDE96B02BF for ; Tue, 28 Nov 2017 03:22:39 -0500 (EST) Received: by mail-wr0-f200.google.com with SMTP id r2so15462131wra.4 for ; Tue, 28 Nov 2017 00:22:39 -0800 (PST) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id c4si7700592wrd.327.2017.11.28.00.22.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 Nov 2017 00:22:38 -0800 (PST) Subject: Re: [PATCH] mm/page_owner: Use PTR_ERR_OR_ZERO() References: <1511824101-9597-1-git-send-email-gomonovych@gmail.com> From: Vlastimil Babka Message-ID: Date: Tue, 28 Nov 2017 09:22:37 +0100 MIME-Version: 1.0 In-Reply-To: <1511824101-9597-1-git-send-email-gomonovych@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Vasyl Gomonovych , akpm@linux-foundation.org, mhocko@suse.com, gregkh@linuxfoundation.org, tglx@linutronix.de, vinmenon@codeaurora.org, guptap@codeaurora.org, linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org On 11/28/2017 12:08 AM, Vasyl Gomonovych wrote: > 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 > > Signed-off-by: Vasyl Gomonovych Acked-by: Vlastimil Babka > --- > mm/page_owner.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/mm/page_owner.c b/mm/page_owner.c > index 4f44b95b9d1e..79ae586d1bce 100644 > --- a/mm/page_owner.c > +++ b/mm/page_owner.c > @@ -636,9 +636,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) > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org