From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 29 Jul 2016 10:39:41 +0200 (CEST) From: Sebastian Ott Subject: Re: [PATCH] s390/pci: Remove unnecessary if condition In-Reply-To: <20160729083150.GA8819@amitoj-Inspiron-3542> References: <20160729083150.GA8819@amitoj-Inspiron-3542> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Message-Id: Sender: linux-kernel-owner@vger.kernel.org List-Archive: List-Post: To: Amitoj Kaur Chawla Cc: gerald.schaefer@de.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, julia.lawall@lip6.fr List-ID: On Fri, 29 Jul 2016, Amitoj Kaur Chawla wrote: > Remove unnecessary error handling because the only failure value that > can be returned is NULL and so the test can never be true. > > The Coccinelle semantic patch used to make this change is as follows: > @@ > expression e; > @@ > > e = debugfs_create_file(...); > - if(IS_ERR(e)) { e = NULL; } Nope. For !CONFIG_DEBUG_FS debugfs_create_file returns an ERR_PTR. Regards, Sebastian