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


Groups > linux.kernel > #1293383

Re: [PATCH] SCSI-lpfc: Delete unnecessary checks before the function call "mempool_destroy"

From James Smart <james.smart@avagotech.com>
Newsgroups linux.kernel
Subject Re: [PATCH] SCSI-lpfc: Delete unnecessary checks before the function call "mempool_destroy"
Date 2015-12-17 00:20 +0100
Message-ID <qGtwt-8ei-3@gated-at.bofh.it> (permalink)
References (13 earlier) <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> <qvK7E-2Dd-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


fyi - this patch was just pushed in our 11.0.0.10 patch set - patch 15/17

-- james s


On 11/17/2015 12:44 AM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 17 Nov 2015 09:34:27 +0100
>
> The mempool_destroy() 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 <elfring@users.sourceforge.net>
> ---
>   drivers/scsi/lpfc/lpfc_mem.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_mem.c b/drivers/scsi/lpfc/lpfc_mem.c
> index 3fa6533..4fb3581 100644
> --- a/drivers/scsi/lpfc/lpfc_mem.c
> +++ b/drivers/scsi/lpfc/lpfc_mem.c
> @@ -231,15 +231,13 @@ lpfc_mem_free(struct lpfc_hba *phba)
>   	if (phba->lpfc_hbq_pool)
>   		pci_pool_destroy(phba->lpfc_hbq_pool);
>   	phba->lpfc_hbq_pool = NULL;
> -
> -	if (phba->rrq_pool)
> -		mempool_destroy(phba->rrq_pool);
> +	mempool_destroy(phba->rrq_pool);
>   	phba->rrq_pool = NULL;
>   
>   	/* Free NLP memory pool */
>   	mempool_destroy(phba->nlp_mem_pool);
>   	phba->nlp_mem_pool = NULL;
> -	if (phba->sli_rev == LPFC_SLI_REV4 && phba->active_rrq_pool) {
> +	if (phba->sli_rev == LPFC_SLI_REV4) {
>   		mempool_destroy(phba->active_rrq_pool);
>   		phba->active_rrq_pool = NULL;
>   	}

--
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-lpfc: Delete unnecessary checks before the function  call "mempool_destroy" James Smart <james.smart@avagotech.com> - 2015-12-17 00:20 +0100

csiph-web