From patchwork Wed Dec 13 20:17:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 848222 X-Patchwork-Delegate: boris.brezillon@free-electrons.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="foaqG6ex"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yxp0z2Gz1z9s81 for ; Thu, 14 Dec 2017 07:18:27 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Ug1M5gD5joHvwlFAnHS80T2AxhE9kQH8O9+fDKJtlOg=; b=foaqG6exWBGnbO aZFzuABnuXZFA65O6ovCNqqcYnyUs/K14X/2BcroRd8cAuUkMVLo8gFJVJ8vHTz/LTCmuwZeAebTI 63a822LCbc7qld8MOzFMfa5NbVuyLDmgpPm3qq4CJwEM1Tizup5Yn9iq+ts5dzs/A1jXBTbb34o4p jx0jdz8QYuTvdZleIN0AVgYLa32HGJVhtCzAC1KK6JLI1/M9B5dNxGLDh02PQq8kVVUceemyGU0sz vu7CNJjd9X0Kh0jZSM3hj8WO8El6OU1DyYnXg2Uyf+WlMBjn1C4cMfgV9kvznsPsLOrpqIA4Nbaqp GFcKeyFbDoC8yGbrIbJA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ePDTu-0006hv-5w; Wed, 13 Dec 2017 20:18:18 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ePDTr-0006fG-JO for linux-mtd@lists.infradead.org; Wed, 13 Dec 2017 20:18:17 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1ePDTL-00032z-Gj; Wed, 13 Dec 2017 20:17:43 +0000 From: Colin King To: Boris Brezillon , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Cyrille Pitchen , linux-mtd@lists.infradead.org Subject: [PATCH][mtd-next] mtd: nand: remove redundant check of len Date: Wed, 13 Dec 2017 20:17:43 +0000 Message-Id: <20171213201743.27324-1-colin.king@canonical.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171213_121815_865506_D3EC7ACC X-CRM114-Status: UNSURE ( 8.49 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [91.189.89.112 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [91.189.89.112 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Colin Ian King The check of len being zero is redundant as it has already been sanity checked for this value at the start of the function. Hence it is impossible for this test to be true and so the redundant code can be removed. Detected by CoverityScan, CID#1462748 ("Logically dead code") Signed-off-by: Colin Ian King --- drivers/mtd/nand/nand_base.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index afd5e18db81c..9daaa23db943 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -1507,10 +1507,6 @@ static int nand_read_param_page_op(struct nand_chip *chip, u8 page, void *buf, }; struct nand_operation op = NAND_OPERATION(instrs); - /* Drop the DATA_IN instruction if len is set to 0. */ - if (!len) - op.ninstrs--; - return nand_exec_op(chip, &op); }