From patchwork Wed Dec 16 23:12:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 7866751 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AB76F9F387 for ; Wed, 16 Dec 2015 23:12:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D397B202FF for ; Wed, 16 Dec 2015 23:12:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 05BBD203B8 for ; Wed, 16 Dec 2015 23:12:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934252AbbLPXMh (ORCPT ); Wed, 16 Dec 2015 18:12:37 -0500 Received: from mail-pf0-f179.google.com ([209.85.192.179]:35598 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755302AbbLPXMZ (ORCPT ); Wed, 16 Dec 2015 18:12:25 -0500 Received: by mail-pf0-f179.google.com with SMTP id v86so19539441pfa.2 for ; Wed, 16 Dec 2015 15:12:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=date:from:to:subject:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=ETHBE8zp47jl6i5/ZwgfZ2oHSUf6PV2boiB6+PAYsag=; b=tmu0xzst6a1xsvCuvLZEEH0vyNs1O1BIRUqdcxlXWM2hU2hYcgAwd15jbtUjMdXsKK 62JJh4IPRAZ2nvqdIKkU0v65PIvzA/OGpliLRYPjw8P/BIzP+k03XgeSHtVj5sosVPWd h792cH+KBlG16FbT546c3AE+MKIZ157cUnmE0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=ETHBE8zp47jl6i5/ZwgfZ2oHSUf6PV2boiB6+PAYsag=; b=PPuLigHJBKtIL732topAIqKZKoPZvy3Uodhfs3e8bA62V32hzlBIUc+K7leaTEmAjF GKnewvO80IdY+LVhCV7sNI6EKbZUZcZmXEBGARPINcALpDZlvYdnElUhZIwPz9FPP4tB PhUuYJkXIY7vAE/wYwV/4jiqch3ohzoHOXYpGw1gVWNus/UBe60UoE0Px+6CrTcfh7Nz oBtOV/lcIRMcMSp6Rry4p9hNBUyrF/aLgpnTKjmQnz/jIXpRl/CWQzGROyxWTfwesxOk 8873kFyChqq31dSAvDPxvXAJx7UmUE9FcIxcaGxXPtVevtAcbdvoIVBa34RQ1OLST0hu xnAw== X-Gm-Message-State: ALoCoQnhnULGsKqC7o3lGUS5nxWyfzjwJzMlSfpYEmNVoML0/2i8C6/jQdgn8iyPgwwLwZDu1Zp6PX6RfajtlMG79M3wQGTLhQ== X-Received: by 10.98.64.80 with SMTP id n77mr9700302pfa.87.1450307545278; Wed, 16 Dec 2015 15:12:25 -0800 (PST) Received: from myfc17 (cm-wififw.emulex.com. [138.239.220.50]) by smtp.gmail.com with ESMTPSA id 25sm7010447pfi.73.2015.12.16.15.12.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 16 Dec 2015 15:12:23 -0800 (PST) Date: Wed, 16 Dec 2015 18:12:06 -0500 From: james.smart@avagotech.com (James Smart) To: linux-scsi@vger.kernel.org Subject: [PATCH 15/17] lpfc: Delete unnecessary checks before the function call "mempool_destroy" Message-ID: <5671efc6.ZwH5WdfbRkt48aQV%james.smart@avagotech.com> User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring 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 Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Reviewed-by: Sebastian Herbszt --- 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; }