From mboxrd@z Thu Jan 1 00:00:00 1970 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 41FD7CCA47B for ; Sun, 17 Jul 2022 14:02:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8F23283AC3; Sun, 17 Jul 2022 16:01:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="QQbvuW2Q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AB11783DEB; Sun, 17 Jul 2022 16:01:57 +0200 (CEST) Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 14E8C839F6 for ; Sun, 17 Jul 2022 16:01:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michael@amarulasolutions.com Received: by mail-pg1-x531.google.com with SMTP id 23so8466455pgc.8 for ; Sun, 17 Jul 2022 07:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1wAm36nbP9Pl46WGetKNvF1rFXu6D5pkwBEy9kJV+as=; b=QQbvuW2QK9L+dEtfHuHyvlg0sTyYz9T9/9pZp5u2YC38glHh+JBpFcNMDs+ZUo3FAX aqHLV4Ol8zCVqyhTzYs/RxFu8HhG+eKYdjzyxIF7w5vlpVSCpJeAynlsP4eY3lpL9TMB AFXmtmplHm/hwKHMo1xQILZZaQk1FST61cv8U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1wAm36nbP9Pl46WGetKNvF1rFXu6D5pkwBEy9kJV+as=; b=svTF3A6XpALyh+JFS/TX1aeV47KOuIoJwSxXXyTNyAZ3T3GM6SAfmpTLWMn8zrgYqX 8qD8UHhsHGSIMtGDxR0TXMszuNa8kRNf60KxWtaUqkB9Q/GNuTofaq0gqDLyRKPMR1qQ 0e1RpDC5YzNp9C9Lda+lZwN+yB4wzEHxtOIFzn37vfDwnMT08B2X0EiwYXILNyxmFjfP T2M6IJG481MO63FJUJjDgOacBMQgkZucnTjccglbLEjz6z/IZvI9WVPFoeYcOlBl4bKJ IoFgo3Y9j96MJ0vFPXPivR5czpOimHtHGLu0LYh/tii9d8ygJdanKso1qRU+kfTVt5dX hFnQ== X-Gm-Message-State: AJIora/+mYn7A/UMIK/jITgZ5G/CzBqHFIomRFl06hZQRWnLH2VE90XX DOWvDlzkG4IbMqX+bJLCNyQENpv+Kyuel9Lg4WpTtA== X-Google-Smtp-Source: AGRyM1szcwdpGDAFqOoPPELTmU3yfECVbKUdzJsmTQQv+aADN1r8ZbvBkLZ6c8NzaXC4lcdjbq3DxBNIETZNMvYCctA= X-Received: by 2002:a63:1f58:0:b0:41a:27e8:d669 with SMTP id q24-20020a631f58000000b0041a27e8d669mr1027872pgm.74.1658066513093; Sun, 17 Jul 2022 07:01:53 -0700 (PDT) MIME-Version: 1.0 References: <20220714031526.33697-1-samuel@sholland.org> <20220714031526.33697-4-samuel@sholland.org> In-Reply-To: <20220714031526.33697-4-samuel@sholland.org> From: Michael Nazzareno Trimarchi Date: Sun, 17 Jul 2022 16:01:41 +0200 Message-ID: Subject: Re: [PATCH 3/6] mtd: nand: sunxi: Remove an unnecessary check To: Samuel Holland Cc: u-boot@lists.denx.de, Jagan Teki , Andre Przywara , Dario Binacchi , Hans de Goede , Lukasz Majewski , Sean Anderson , Simon Glass Content-Type: text/plain; charset="UTF-8" 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 Hi On Thu, Jul 14, 2022 at 5:15 AM Samuel Holland wrote: > > 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 > Reviewed-by: Michael Trimarchi -- Michael Nazzareno Trimarchi Co-Founder & Chief Executive Officer M. +39 347 913 2170 michael@amarulasolutions.com __________________________________ Amarula Solutions BV Joop Geesinkweg 125, 1114 AB, Amsterdam, NL T. +31 (0)85 111 9172 info@amarulasolutions.com www.amarulasolutions.com