Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753005AbbKQIom (ORCPT ); Tue, 17 Nov 2015 03:44:42 -0500 Received: from mout.web.de ([212.227.17.11]:57030 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751742AbbKQIok (ORCPT ); Tue, 17 Nov 2015 03:44:40 -0500 Subject: [PATCH] SCSI-lpfc: Delete unnecessary checks before the function call "mempool_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: Dick Kennedy , "James E. J. Bottomley" , James Smart , linux-scsi@vger.kernel.org Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <564AE8EB.4050509@users.sourceforge.net> Date: Tue, 17 Nov 2015 09:44:27 +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:jYYT/3K5ZTRa0pA6ESZkduiQQ6Hd+b/E7LPOURnLmBm6tKIZnkG KmyMWXURrwhSNm/I1NUthugp2WGgiXWr7tsAbifHpyEw3+ETjmIMygz0BhfO+NYjwC/NeLc Uhdf7aqIy4QLcLXalOmU4hUWPD+x1tBsEzIHoX5Il9jPvyPjsb6pz01kEOQmJuEz2rDFzOq emq+cIn37ccQDZ+cLWUrQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:NgMzb+SkFlk=:98NDuxIBOCXJG6DwlFHIqA TkH6XAeyP+kzDfC5gSn/uDxNch9tEnh8bdVDyQklxi12B00dpOlC3s4+CNjLIfSe4B38F3qxt LZ6JVXehDS9YdtxG+8v41pVCSrS0Xw+0qWeIwk+/0hYEiHDWpxPqPP/9OjfH4zIfsqdWI4J+W w2dsjNpOSSV39qhtvHur9hBeHg+5vbVrt8ucBO568h6LYMENSXB/vtKapw1iwap1qE7JAf5OO VhWTeRvs87c+B2K89Z/xBcOX4VFGGDBVKpMYLkXU/pU2ScaLCvQcvOduT4Qk1hhv61Xp6lNRS A+iCmY2kd9hZQgzEew5/iTn4tfMjT0KRqfr7HceUxzcYcXq7XOSyQe9gK3mEthFCOwUm3nTD+ 8OXl+UrSV7AnnwG4rgATggyoKybYlc4M4qBHozGXBauHx0zh/KfzK7lciLK6pgri4KAf5dDmX 6io/3DAoTyvY9u12U8HBt/CQJe7XHjwIMPqKCAAYbTIII0nB6SDu6GntqHHF3j+BKE1mWPT7w AEK+ZFUY36HYBF0RXVc6sLyAgIXHBLAOdcumIzUWzbG0jy7/Xw19MROrr8WcAp7W4kqY4TbmY OGkcZxYfhLXNIjAaUxnd/9Ud4zqFcjmGfA98iTuOQ62EmuQuucIf3MQqbT3vgSpM9/d5hBQ+5 Wpm/5sM77uOX1IxSgSUxLEHOSaaSFst1rfdhTHed0DrhHlilqboqGGluN0M0VFIyy8fFsuv7h bYljpsJWJ+O9BhBMTD3/9uJ2FzVgt7UY9ZPktOVLC0rhQcGbjVpaYSEen+1Wh3Y8FTD1kd7Xk l8rUkWa Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1442 Lines: 43 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; } -- 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/