Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1452356

Re: [PATCH] s390/pci: Remove unnecessary if condition

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Sebastian Ott <sebott@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH] s390/pci: Remove unnecessary if condition
Date Fri, 29 Jul 2016 11:50:01 +0200
Message-ID <s0cAx-2RM-1@gated-at.bofh.it> (permalink)
References <s0buO-2d6-21@gated-at.bofh.it> <s0buO-2d6-19@gated-at.bofh.it> <s0bEt-2gP-5@gated-at.bofh.it>
X-Original-To Julia Lawall <julia.lawall@lip6.fr>
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 "IBM Deutschland Research & Development GmbH / Vorsitzende des Aufsichtsrats: Martina Koederitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294"
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 <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 37
X-Original-Cc Amitoj Kaur Chawla <amitoj1606@gmail.com>, Gerald Schaefer <gerald.schaefer@de.ibm.com>, Martin Schwidefsky <schwidefsky@de.ibm.com>, Heiko Carstens <heiko.carstens@de.ibm.com>, 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 <alpine.LFD.2.20.1607291138100.3349@schleppi>
X-Original-References <20160729083150.GA8819@amitoj-Inspiron-3542> <alpine.LFD.2.20.1607291037530.3349@schleppi> <alpine.DEB.2.10.1607291046000.2161@hadrien>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1452356

Show key headers only | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] s390/pci: Remove unnecessary if condition Sebastian Ott <sebott@linux.vnet.ibm.com> - 2016-07-29 10:40 +0200
  Re: [PATCH] s390/pci: Remove unnecessary if condition Julia Lawall <julia.lawall@lip6.fr> - 2016-07-29 10:50 +0200
    Re: [PATCH] s390/pci: Remove unnecessary if condition Sebastian Ott <sebott@linux.vnet.ibm.com> - 2016-07-29 11:50 +0200
      Re: [PATCH] s390/pci: Remove unnecessary if condition Julia Lawall <julia.lawall@lip6.fr> - 2016-08-01 08:40 +0200

csiph-web