From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f198.google.com (mail-wr0-f198.google.com [209.85.128.198]) by kanga.kvack.org (Postfix) with ESMTP id 6D9DD6B02B9 for ; Tue, 28 Nov 2017 03:14:37 -0500 (EST) Received: by mail-wr0-f198.google.com with SMTP id k100so20347864wrc.9 for ; Tue, 28 Nov 2017 00:14:37 -0800 (PST) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id o3si3040505edi.503.2017.11.28.00.14.36 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 Nov 2017 00:14:36 -0800 (PST) Date: Tue, 28 Nov 2017 09:14:35 +0100 From: Michal Hocko Subject: Re: [PATCH] mm/page_owner: Use PTR_ERR_OR_ZERO() Message-ID: <20171128081435.errtatm3nm36zq24@dhcp22.suse.cz> References: <1511824101-9597-1-git-send-email-gomonovych@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1511824101-9597-1-git-send-email-gomonovych@gmail.com> Sender: owner-linux-mm@kvack.org List-ID: To: Vasyl Gomonovych Cc: vbabka@suse.cz, akpm@linux-foundation.org, gregkh@linuxfoundation.org, tglx@linutronix.de, vinmenon@codeaurora.org, guptap@codeaurora.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org On Tue 28-11-17 00:08:21, 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 OK, this is easier to read. Is this the only place that we have in the mm tree? I do not see more patches on linux-mm mailing list. > Signed-off-by: Vasyl Gomonovych Acked-by: Michal Hocko > --- > 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) > -- > 1.9.1 > -- Michal Hocko SUSE Labs -- 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