Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752229AbbKPIp5 (ORCPT ); Mon, 16 Nov 2015 03:45:57 -0500 Received: from mout.web.de ([212.227.17.12]:56641 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751124AbbKPIpy (ORCPT ); Mon, 16 Nov 2015 03:45:54 -0500 Subject: [PATCH] SCSI-libfc: Delete an unnecessary check before the function call "kmem_cache_destroy" 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> To: "James E. J. Bottomley" , fcoe-devel@open-fcoe.org, linux-scsi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <564997B5.6030703@users.sourceforge.net> Date: Mon, 16 Nov 2015 09:45:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <5317A59D.4@users.sourceforge.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:eU+0LJ1ewLACOBy5HlbDz6YEuwFhcN0AyT7V9ZivB7Bk9W4BCXW rCuSRsNDrt4nbMCEMGlQJNdfQKqGwuRnJLR6LfuLZ8yUZLkVDGx0HO8s99LBYgOMUEBh+n+ Pm9pv6GuIVoGxSh+ebO8RCFntREhtPDCGYBGohFRJnDIkcvaiaOaCGXfAB04zCCcZFjG1TN 3hala+chx0OgtddyoCeCQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:o0IVGyC8aCE=:xn6BlzpYFe2ZfUPAVpAtVP IcFGS1VHPD1r24821eKcfpOrwCNZdvba8eyECNBkNbOBy/VeCq6mbWxtHHkGiXxa+O90X82kZ 55SQzlVvRsCFxTg6udBr2iMT11z96POkp/0tjgIEG9XuioSztMZZeD9RGb4CTZ/JNXN/sCJ1R AaYfjtZAxQSdxpqufx4LIebHFTD4qtGNGc9pukP77ZcRGhUqhVMKbh0o1cvRYz0V7oRF8hMLR aN/8zkB2nXSUkOaT7WhL8fkjJXgXiRgyzJIvgJ8Z9XlDqvwJ1iOq+FH8Li1WGsDEbVWriVKZj ZGxNsxQ+rmZx6+EjC4EMfafxiGal2ozQg1r3Bnm3X45oHcdpIKiWCSQ8HIHJjoUMsX+Icu6zr m3qq4Fs2/zyRebeLw7T1OKD3Sw0fT4KFKZu5tGeBC6K1YqwmYJOHVEpJB+mklS6EaQ3RMmvht 2f0jA7MPGkSXr4ZkYYlPVZWfXB0dREgh9wvTr3iaK56CX28yL9MwuU8zGP71M6kEf7UhdrH9T uy1kc4CH6Uo2tV/vvoi5jADkvGoLLbqh9jed18hLL9xNZg0GWMW/khPUOVNd0tPT5as3IrSCx doFKGywl5CGSc0JWItirWeEMjtJWtkWnBeFr8N00FjwDfvje5g9ZwVajUieReGU7C6/GiFfV3 WbAhM2E861i9VvzjBT77c3kvkX32ejh3SOW+TaPLgFgvml33VUgbBqd2OSVkE5DLg81QZ0iy+ yGoFzUkOOf/IClox2dYPvr+IqdvjVqEYdxPO+tmmjD4T334Fl0f67ioyxdO/PxGFsXUe7hhe3 igtmWoq Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1062 Lines: 35 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); } /** -- 2.6.2 -- 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/