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 EBFD4C38142 for ; Sun, 22 Jan 2023 22:07:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1602F856A2; Sun, 22 Jan 2023 23:07:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (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="ntmYsJoW"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="CNNoQAq1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ECBEC856B4; Sun, 22 Jan 2023 23:06:51 +0100 (CET) Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (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 073F0856AF for ; Sun, 22 Jan 2023 23:06:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id D976B32004CE; Sun, 22 Jan 2023 17:06:46 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 22 Jan 2023 17:06:47 -0500 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=1674425206; x=1674511606; bh=F+ fdrOGIiFGyYoBl7nqpXQUeq35SaVUSrmYrcCG7EKM=; b=ntmYsJoWdE+nHscjIe xwWl6B0udw8z0spdfAdDBgBCj37ssEIL9AqG2PcG7oEDASnsmkHpibAPwTRkpTBX Xcgf6VemW0ItGYn+/dSk5TU7UdDC3OqgX5FgmStng2NAP7RrooQWgmcIPf2hcJ8B AxnCJ6EMpy9ZgIG7nM3Lgx1nDKjZ5tmcSYr0rrVLyuHheq2plr56JGt5YpMMJb3v YxO6R6deyweXgwfwt9ojgVcH+GG6Kr7cD+vMEr4kvLpae/sVrLS8H1Ico5hYmMnu idELHHx9R5uMgDwlwn88VIYRywtqOXJ5LCPXIJD6IvWuTB9gAU01PiZ29P5NFZ6V 3iBA== 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=1674425206; x=1674511606; bh=F+fdrOGIiFGyY oBl7nqpXQUeq35SaVUSrmYrcCG7EKM=; b=CNNoQAq1UsMyEuh7M3W+xo67WCFcl X5knLE5EfVrlYsr9oijXTGvCaLYlaBfFEelATWGRx2Sa054g3K3T+p7mpeZrjFEB jI8idENMVl3sWFggsP+GfwxAmnMmDT3bWDeQZJPBJVVbHlMBNFor29AS4Kd2ojCN mF3G3AslOMvV/AVOUOIS02r7vZxChBrUiB/mT+ZDcmhSCaffcyujI3wFs5kPH9e0 BCpGvcrfD/MXlbQLha2IdSiHl1aCk077gJci0kjNC33DoaeaDWS3LkVV02p3XoWe UTIppn09qEmv1zZOhNe0c3KiVizOGlH9equdqhMXr4/wJhIJ6bLcLALXw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudduiedgudeitdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghm uhgvlhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenuc ggtffrrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeeh gfdufeeitdevteenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfh hrohhmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 22 Jan 2023 17:06:45 -0500 (EST) From: Samuel Holland To: Andre Przywara , Jagan Teki , Michael Trimarchi Cc: Samuel Holland , Dario Binacchi , Hans de Goede , Lukasz Majewski , Sean Anderson , Simon Glass , u-boot@lists.denx.de Subject: [PATCH v2 3/6] mtd: nand: sunxi: Remove an unnecessary check Date: Sun, 22 Jan 2023 16:06:33 -0600 Message-Id: <20230122220637.41496-4-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20230122220637.41496-1-samuel@sholland.org> References: <20230122220637.41496-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. Reviewed-by: Michael Trimarchi Signed-off-by: Samuel Holland --- (no changes since v1) 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 c378f08f68..0f10edfdb2 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.37.4