From patchwork Thu Mar 1 22:26:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10252761 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4AB16604D4 for ; Thu, 1 Mar 2018 22:26:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B37527816 for ; Thu, 1 Mar 2018 22:26:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30126286A7; Thu, 1 Mar 2018 22:26:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB3BA286A9 for ; Thu, 1 Mar 2018 22:26:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162537AbeCAW0p (ORCPT ); Thu, 1 Mar 2018 17:26:45 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:33162 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162601AbeCAW0l (ORCPT ); Thu, 1 Mar 2018 17:26:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1519943202; x=1551479202; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=L6NN1MM67X1QOFp/BuwurDlbt+C7iqR8hXJaNNBjjvw=; b=hkn1CirllZOS+6U2Rgx29g/qaorm1tc9oK4O4ykNqHrHOR1pETLMk2mj C0147qCrYsD+JbdgZbMJ7LUl3vqcJN2FQDu3JHSAKesiNE/diEo3vg317 Rrff0px3Jr5WANo7Lu6qgJtm6BlvuV+Qc1iIwFBHbtSE9NEOE1pvN3rHk BjN/vpFPnbaaFDmgfE1zbC0x33LFLFmnECewoTfeQNf4yBwYwZuHgwPDc RgqBCEj5fyQt+x6GPoTcsUBh4HuI5EJrFs5953/jglsBfkNdkc1BAiNZr 72EkEXTCBmoPk55I35DFURwIf/axi0RtWU9nmEwj3Qf68Qjx52bDl7Tjj A==; X-IronPort-AV: E=Sophos;i="5.47,409,1515427200"; d="scan'208";a="72564610" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 02 Mar 2018 06:26:36 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 01 Mar 2018 14:20:39 -0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.171.236]) by uls-op-cesaip01.wdc.com with ESMTP; 01 Mar 2018 14:26:36 -0800 From: Bart Van Assche To: Nicholas Bellinger Cc: Christoph Hellwig , target-devel@vger.kernel.org, Bart Van Assche , Dan Carpenter , Hannes Reinecke , Mike Christie Subject: [PATCH 13/14] target/tcm_loop: Avoid that static checkers warn about dead code Date: Thu, 1 Mar 2018 14:26:31 -0800 Message-Id: <20180301222632.31507-14-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180301222632.31507-1-bart.vanassche@wdc.com> References: <20180301222632.31507-1-bart.vanassche@wdc.com> Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The code under the "release:" label can only be reached after se_cmd has been set to a non-NULL value. Hence remove the if (se_cmd) test. Keep the else-part since calling transport_generic_free_cmd() is not necessary for a command that has not been submitted to the core. Reported-by: Dan Carpenter Fixes: 4d3895d5ea43 ("target/tcm_loop: Merge struct tcm_loop_cmd and struct tcm_loop_tmr") Signed-off-by: Bart Van Assche Cc: Dan Carpenter Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Mike Christie --- drivers/target/loopback/tcm_loop.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 6106c5f4cc41..cb22d1ead93d 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c @@ -239,10 +239,7 @@ static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg, return ret; release: - if (se_cmd) - transport_generic_free_cmd(se_cmd, 0); - else - kmem_cache_free(tcm_loop_cmd_cache, tl_cmd); + kmem_cache_free(tcm_loop_cmd_cache, tl_cmd); goto out; }