Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934473AbbKSSVc (ORCPT ); Thu, 19 Nov 2015 13:21:32 -0500 Received: from mga14.intel.com ([192.55.52.115]:26821 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754165AbbKSSVa (ORCPT ); Thu, 19 Nov 2015 13:21:30 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,318,1444719600"; d="scan'208";a="854842187" Subject: Re: [PATCH] SCSI-libfc: Delete an unnecessary check before the function call "kmem_cache_destroy" From: Vasu Dev To: SF Markus Elfring Cc: "James E. J. Bottomley" , fcoe-devel@open-fcoe.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Julia Lawall In-Reply-To: <564997B5.6030703@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> <564997B5.6030703@users.sourceforge.net> Content-Type: text/plain; charset="UTF-8" Date: Thu, 19 Nov 2015 10:21:28 -0800 Message-ID: <1447957288.5825.83.camel@lin-nd1-054.jf.intel.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.3 (2.32.3-1.fc14) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1219 Lines: 37 On Mon, 2015-11-16 at 09:45 +0100, SF Markus Elfring wrote: > From: Markus Elfring > Date: Mon, 16 Nov 2015 09:39:12 +0100 > > The kmem_cache_destroy() function tests whether its argument is NULL > and then returns immediately. Thus the test around the call is not needed. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > drivers/scsi/libfc/fc_fcp.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c > index 5121272..d377514 100644 > --- a/drivers/scsi/libfc/fc_fcp.c > +++ b/drivers/scsi/libfc/fc_fcp.c > @@ -2216,8 +2216,7 @@ int fc_setup_fcp(void) > > void fc_destroy_fcp(void) > { > - if (scsi_pkt_cachep) > - kmem_cache_destroy(scsi_pkt_cachep); > + kmem_cache_destroy(scsi_pkt_cachep); > } > > /** Looks good. Acked-by: Vasu Dev -- 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/