Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0566C433EF for ; Thu, 14 Jul 2022 03:16:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5B5FE84056; Thu, 14 Jul 2022 05:15:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="ea2qD9w2"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Jn0P5ofd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 00C3884013; Thu, 14 Jul 2022 05:15:40 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2D4CB8403F for ; Thu, 14 Jul 2022 05:15:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 717085C00F3; Wed, 13 Jul 2022 23:15:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 13 Jul 2022 23:15:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1657768532; x=1657854932; bh=Jx l8ZPM51r5bIJu2V0pnqzpFUDxQn/PQzvRGwiG3FwE=; b=ea2qD9w2FFEx/T6Grc qNWrhFGWTE3RJwaDIgX3UGXPN1RN2B5frh7XlAvJkoVQOQlp0xryxUNjqyqk7VB9 8dj+FiL1P2VXI8T/rEWOfybIm9xhajkbHYPx57PbX7AilP5bvBgti45JweGmEdOJ IRRGX8ch8fHG57MYZJURHzXM0eX2d9ALd3z+7kHnBg3MhlDFENl3VNF6e/eNfLCm gPBW2AJAxrI6Ke0h/m39a1TSGyP0vt++Ud68NbmM0TQ+19foJCEU7/x/ajM5Jg3Q ruyPqVQM8EDG/axQurRY545wItloryeElQlYVjYT03Sx+niJVZ/YLi7pDsRlpl6D mUkg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1657768532; x=1657854932; bh=Jxl8ZPM51r5bI Ju2V0pnqzpFUDxQn/PQzvRGwiG3FwE=; b=Jn0P5ofdra+vU6Rl3mELZfYZ49rgQ CWomTglpkRzskeQqg+FrXQ+Ck+uvGK6noLgtAzbiifa0c4LW0i+eiSHxKcL5y6YA dymNgA67l+crmFcXAOWbXhwCTmpGlpljnyWcj72vkUByhrTSJkMKK965h76+snCL x1GxN3SSp+9jA1pUADeEKCj9tTyduVxwvqlhCyCj/etWNI+4OAGWuDNON+adNZ0L O3sOpdVM6m+avcw+5A69i1bx5ZST9RtcYMHelssA3ZKmJ5M8uIh1Xv2c5P4u6Wxo bUagm7K+buB7EziYHcCIO15rUm5j792Fh1fMN9e573s9LPtzVrHr8pL2Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudejkedgieekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepudekteeuudehtdelteevgfduvddvjefhfedulefgudevgeeghefg udefiedtveetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Jul 2022 23:15:31 -0400 (EDT) From: Samuel Holland To: u-boot@lists.denx.de, Jagan Teki , Andre Przywara Cc: Samuel Holland , Dario Binacchi , Hans de Goede , Lukasz Majewski , Michael Trimarchi , Sean Anderson , Simon Glass Subject: [PATCH 3/6] mtd: nand: sunxi: Remove an unnecessary check Date: Wed, 13 Jul 2022 22:15:23 -0500 Message-Id: <20220714031526.33697-4-samuel@sholland.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220714031526.33697-1-samuel@sholland.org> References: <20220714031526.33697-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Each chip is required to have a unique CS number ("reg" property) in the range 0-7, so there is no need to separately count the number of chips. Signed-off-by: Samuel Holland --- drivers/mtd/nand/raw/sunxi_nand.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c index c378f08f6805..0f10edfdb208 100644 --- a/drivers/mtd/nand/raw/sunxi_nand.c +++ b/drivers/mtd/nand/raw/sunxi_nand.c @@ -1766,16 +1766,6 @@ static int sunxi_nand_chips_init(int node, struct sunxi_nfc *nfc) int nand_node; int ret, i = 0; - for (nand_node = fdt_first_subnode(blob, node); nand_node >= 0; - nand_node = fdt_next_subnode(blob, nand_node)) - i++; - - if (i > 8) { - dev_err(nfc->dev, "too many NAND chips: %d (max = 8)\n", i); - return -EINVAL; - } - - i = 0; for (nand_node = fdt_first_subnode(blob, node); nand_node >= 0; nand_node = fdt_next_subnode(blob, nand_node)) { ret = sunxi_nand_chip_init(nand_node, nfc, i++); -- 2.35.1