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


Groups > linux.kernel > #1273354

Re: [PATCH] SCSI-libfc: Delete an unnecessary check before the function call "kmem_cache_destroy"

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Vasu Dev <vasu.dev@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] SCSI-libfc: Delete an unnecessary check before the function call "kmem_cache_destroy"
Date Thu, 19 Nov 2015 19:30:02 +0100
Message-ID <qwC82-4vu-9@gated-at.bofh.it> (permalink)
References <mSsDN-4wa-35@gated-at.bofh.it> <mSsDN-4wa-37@gated-at.bofh.it> <mSsDN-4wa-39@gated-at.bofh.it> <mSsDN-4wa-41@gated-at.bofh.it> <mSsDN-4wa-43@gated-at.bofh.it> <mSsDN-4wa-45@gated-at.bofh.it> <mSsDN-4wa-47@gated-at.bofh.it> <mSsDN-4wa-49@gated-at.bofh.it> <mSsDN-4wa-51@gated-at.bofh.it> <mSsDN-4wa-53@gated-at.bofh.it> <mSsDN-4wa-55@gated-at.bofh.it> <mSsDN-4wa-57@gated-at.bofh.it> <mSsDN-4wa-59@gated-at.bofh.it> <mSsDN-4wa-61@gated-at.bofh.it> <mSsDN-4wa-63@gated-at.bofh.it> <mSsDN-4wa-65@gated-at.bofh.it> <mSsDN-4wa-33@gated-at.bofh.it> <qvnE6-4ZZ-5@gated-at.bofh.it>
X-Original-To SF Markus Elfring <elfring@users.sourceforge.net>
X-Extloop1 1
X-Ironport-Av E=Sophos;i="5.20,318,1444719600"; d="scan'208";a="854842187"
Content-Type text/plain; charset="UTF-8"
MIME-Version 1.0
X-Mailer Evolution 2.32.3 (2.32.3-1.fc14)
Content-Transfer-Encoding 7bit
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
Organization linux.* mail to news gateway
X-Original-Cc "James E. J. Bottomley" <JBottomley@odin.com>, fcoe-devel@open-fcoe.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Julia Lawall <julia.lawall@lip6.fr>
X-Original-Date Thu, 19 Nov 2015 10:21:28 -0800
X-Original-Message-ID <1447957288.5825.83.camel@lin-nd1-054.jf.intel.com>
X-Original-References <5307CAA2.8060406@users.sourceforge.net> <alpine.DEB.2.02.1402212321410.2043@localhost6.localdomain6> <530A086E.8010901@users.sourceforge.net> <alpine.DEB.2.02.1402231635510.1985@localhost6.localdomain6> <530A72AA.3000601@users.sourceforge.net> <alpine.DEB.2.02.1402240658210.2090@localhost6.localdomain6> <530B5FB6.6010207@users.sourceforge.net> <alpine.DEB.2.10.1402241710370.2074@hadrien> <530C5E18.1020800@users.sourceforge.net> <alpine.DEB.2.10.1402251014170.2080@hadrien> <530CD2C4.4050903@users.sourceforge.net> <alpine.DEB.2.10.1402251840450.7035@hadrien> <530CF8FF.8080600@users.sourceforge.net> <alpine.DEB.2.02.1402252117150.2047@localhost6.localdomain6> <530DD06F.4090703@users.sourceforge.net> <alpine.DEB.2.02.1402262129250.2221@localhost6.localdomain6> <5317A59D.4@users.sourceforge.net> <564997B5.6030703@users.sourceforge.net>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1273354

Show key headers only | View raw


On Mon, 2015-11-16 at 09:45 +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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 <elfring@users.sourceforge.net>
> ---
>  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 <vasu.dev@intel.com>

--
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/

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


Thread

Re: [PATCH] SCSI-libfc: Delete an unnecessary check before the  function call "kmem_cache_destroy" Vasu Dev <vasu.dev@linux.intel.com> - 2015-11-19 19:30 +0100

csiph-web