From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752507AbcG2Ipl (ORCPT ); Fri, 29 Jul 2016 04:45:41 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:7088 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbcG2Ipj (ORCPT ); Fri, 29 Jul 2016 04:45:39 -0400 X-IronPort-AV: E=Sophos;i="5.28,438,1464645600"; d="scan'208";a="228356129" Date: Fri, 29 Jul 2016 10:46:43 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Sebastian Ott cc: Amitoj Kaur Chawla , 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 Subject: Re: [PATCH] s390/pci: Remove unnecessary if condition In-Reply-To: Message-ID: References: <20160729083150.GA8819@amitoj-Inspiron-3542> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? julia