Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750704AbbKYJhh (ORCPT ); Wed, 25 Nov 2015 04:37:37 -0500 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:54098 "EHLO e06smtp16.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750924AbbKYJhc (ORCPT ); Wed, 25 Nov 2015 04:37:32 -0500 X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: ubraun@linux.vnet.ibm.com X-IBM-RcptTo: kernel-janitors@vger.kernel.org;linux-kernel@vger.kernel.org;linux-s390@vger.kernel.org Message-ID: <1448444246.15843.2.camel@BR9GV9YG.de.ibm.com> Subject: Re: [PATCH] s390-ctcm: Delete unnecessary checks before the function call "channel_remove" From: Ursula Braun To: SF Markus Elfring Cc: linux-s390@vger.kernel.org, Ursula Braun , Martin Schwidefsky , Heiko Carstens , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Julia Lawall Date: Wed, 25 Nov 2015 10:37:26 +0100 In-Reply-To: <564B7DEF.6050005@users.sourceforge.net> References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <564B7DEF.6050005@users.sourceforge.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15112509-0025-0000-0000-000007E9B213 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1621 Lines: 44 Applied to our local git. Thanks. It will be part of my next patch submission for net-next. Kind regards, Ursula Braun, IBM Germany On Tue, 2015-11-17 at 20:20 +0100, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 17 Nov 2015 20:10:02 +0100 > > The channel_remove() function tests whether its argument is NULL > and then returns immediately. Thus the test around the calls is not needed. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > drivers/s390/net/ctcm_main.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c > index 05c37d6..c3e2252 100644 > --- a/drivers/s390/net/ctcm_main.c > +++ b/drivers/s390/net/ctcm_main.c > @@ -1677,11 +1677,8 @@ static int ctcm_shutdown_device(struct ccwgroup_device *cgdev) > > ccw_device_set_offline(cgdev->cdev[1]); > ccw_device_set_offline(cgdev->cdev[0]); > - > - if (priv->channel[CTCM_READ]) > - channel_remove(priv->channel[CTCM_READ]); > - if (priv->channel[CTCM_WRITE]) > - channel_remove(priv->channel[CTCM_WRITE]); > + channel_remove(priv->channel[CTCM_READ]); > + channel_remove(priv->channel[CTCM_WRITE]); > priv->channel[CTCM_READ] = priv->channel[CTCM_WRITE] = NULL; > > return 0; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/