Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755129AbbLPXR3 (ORCPT ); Wed, 16 Dec 2015 18:17:29 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:33513 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752736AbbLPXR0 (ORCPT ); Wed, 16 Dec 2015 18:17:26 -0500 Subject: Re: [PATCH] SCSI-lpfc: Delete unnecessary checks before the function call "mempool_destroy" To: SF Markus Elfring , Dick Kennedy , "James E. J. Bottomley" , linux-scsi@vger.kernel.org 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> <564AE8EB.4050509@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: James Smart Message-ID: <5671F103.8070404@avagotech.com> Date: Wed, 16 Dec 2015 15:17:23 -0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <564AE8EB.4050509@users.sourceforge.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1648 Lines: 47 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 > 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 > --- > 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/