Path: csiph.com!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod From: Sebastian Ott Newsgroups: linux.kernel Subject: Re: [PATCH] s390/pci: Remove unnecessary if condition Date: Fri, 29 Jul 2016 11:50:01 +0200 Message-ID: References: X-Original-To: Julia Lawall X-Ibm-Helo: d06dlp03.portsmouth.uk.ibm.com X-Ibm-Mailfrom: sebott@linux.vnet.ibm.com X-Ibm-Rcptto: linux-kernel@vger.kernel.org;linux-s390@vger.kernel.org X-X-Sender: sebott@schleppi User-Agent: Alpine 2.20 (LFD 67 2015-01-07) Organization: =?ISO-8859-15?Q?=22IBM_Deutschland_Research_&_Development_GmbH_=2F_Vorsitzende_des_Aufsichtsrats=3A_Martina_Koederitz_Gesch=E4ftsf=FChrung=3A_Dirk_Wittkopp_Sitz_der_Gesellschaft=3A_B=F6blingen_=2F_Registergericht?= =?ISO-8859-15?Q?=3A_Amtsgericht_Stuttgart=2C_HRB_243294=22?= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Tm-As-Mml: disable X-Content-Scanned: Fidelis XPS MAILER X-Cbid: 16072909-0028-0000-0000-000001F7628C X-Ibm-Av-Detection: SAVI=unused REMOTE=unused XFE=unused X-Cbparentid: 16072909-0029-0000-0000-00001FC19D18 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-07-29_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607290102 Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 37 X-Original-Cc: Amitoj Kaur Chawla , Gerald Schaefer , Martin Schwidefsky , Heiko Carstens , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org X-Original-Date: Fri, 29 Jul 2016 11:46:08 +0200 (CEST) X-Original-Message-ID: X-Original-References: <20160729083150.GA8819@amitoj-Inspiron-3542> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1452356 On Fri, 29 Jul 2016, Julia Lawall wrote: > On Fri, 29 Jul 2016, Sebastian Ott wrote: > > 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. > > Clicking around in lxr doesn't show that, but perhaps an alternative > definition is overlooked? It looks that way. [sebott@schleppi linux]$ git grep -W "debugfs_create_file(" include/linux/debugfs.h include/linux/debugfs.h:struct dentry *debugfs_create_file(const char *name, umode_t mode, include/linux/debugfs.h- struct dentry *parent, void *data, include/linux/debugfs.h- const struct file_operations *fops); -- include/linux/debugfs.h:static inline struct dentry *debugfs_create_file(const char *name, umode_t mode, include/linux/debugfs.h- struct dentry *parent, void *data, include/linux/debugfs.h- const struct file_operations *fops) include/linux/debugfs.h-{ include/linux/debugfs.h- return ERR_PTR(-ENODEV); include/linux/debugfs.h-} include/linux/debugfs.h- Regards, Sebastian