Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13672345pxu; Mon, 4 Jan 2021 00:51:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzeL1v2MY2wz357mNWJEptnUNnrnbdNbN2HVS+DYX/y6L13uMXVPZ2siUQipfr7cb8HpKF X-Received: by 2002:a05:6402:45:: with SMTP id f5mr69662630edu.273.1609750270910; Mon, 04 Jan 2021 00:51:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609750270; cv=none; d=google.com; s=arc-20160816; b=vIXPNUOYMb9+kQfMXmOQ9ZSJnHGeuT9q14LHpdvi/nmwA8uRi0o1ELPZvvuqPEKiO8 798nvFFbeWRdoeAhwDVzITES0cQzzERTPvehxisUMlM8O/sEh8ZiZwIbNnSddRB/IiT8 wEOFRg3w1fAv0IahSvz6KvUQe8rm0U0aZb7jbA6vj6sf3QxaRu+1EtZYz0n4QT+mmJmC pRQUL1H7ZAZnegF6KjgkXm2E4xSMAhOqGCBGOJbqoY9QiIyzf4hwds3aD0avRfUnMCFk RKRa+xL8//EA/q+L69OXSfdMcPl7mFmegZWN1j3bbetCiw54tbBUmHbuALu2CwIrM5JE 6Axg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=dQyD6Ts90eaqabCcwhi3W2NR7aob6esG38nfDN4VzcM=; b=pA+d+aUzbk59mneYjDmX6s/eHQV8IydWV+RASwuKH53bUlVM6Et/ZinyuHAttMM9UO NSq8lqJgUn2Rl3veY97jWSNSp2TcD3fxwPMw0kwZLB/DFX+/N6RKXNgEXIeQHuo/YReE e9qKo7Zm+MQdslZzwc7Y1pjfmzeE/TLXND7d44cSp+Q4xPtEcmLSjeTRp0929sFGLrOP O14zR0BdMJbwfISGg8f9HUAQ0e7EqNJp2kQds7JXQwcDBcfxEnG/031YwD9jJ3oCWwBa k9Peqq2AvAi8q1Mjrhy8yKzcHMljKhgYu0MpKWghjH/sWCTPIxFjhOZ2d7ClDERFzMNA Go0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co9si29402059edb.379.2021.01.04.00.50.47; Mon, 04 Jan 2021 00:51:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726605AbhADIte convert rfc822-to-8bit (ORCPT + 99 others); Mon, 4 Jan 2021 03:49:34 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:54095 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726333AbhADItd (ORCPT ); Mon, 4 Jan 2021 03:49:33 -0500 X-Originating-IP: 90.89.98.255 Received: from xps13 (lfbn-tou-1-1535-bdcst.w90-89.abo.wanadoo.fr [90.89.98.255]) (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id EF2E3240010; Mon, 4 Jan 2021 08:48:50 +0000 (UTC) Date: Mon, 4 Jan 2021 09:48:49 +0100 From: Miquel Raynal To: Martin Blumenstingl Cc: vadivel.muruganx.ramuthevar@linux.intel.com, linux-mtd@lists.infradead.org, richard@nod.at, vigneshr@ti.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd: rawnand: intel: remove broken code Message-ID: <20210104094849.1850c993@xps13> In-Reply-To: <20201217221148.2877318-1-martin.blumenstingl@googlemail.com> References: <20201217221148.2877318-1-martin.blumenstingl@googlemail.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Martin, Martin Blumenstingl wrote on Thu, 17 Dec 2020 23:11:48 +0100: > Drop the check for mtd->name as it's executed while the mtd variable is > always NULL. If some MTD name is needed then it should be validated by > the MTD core. > > While here, also drop the NULL assignment to the mtd variable as it's > overwritten later on anyways and the NULL value is never read. > > Fixes: 0b1039f016e8a3 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC") > Signed-off-by: Martin Blumenstingl > --- > I found this by looking at the new driver. This patch is compile-tested > only. > > > drivers/mtd/nand/raw/intel-nand-controller.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/mtd/nand/raw/intel-nand-controller.c b/drivers/mtd/nand/raw/intel-nand-controller.c > index fdb112e8a90d..398de6ec68d7 100644 > --- a/drivers/mtd/nand/raw/intel-nand-controller.c > +++ b/drivers/mtd/nand/raw/intel-nand-controller.c > @@ -579,7 +579,7 @@ static int ebu_nand_probe(struct platform_device *pdev) > struct device *dev = &pdev->dev; > struct ebu_nand_controller *ebu_host; > struct nand_chip *nand; > - struct mtd_info *mtd = NULL; > + struct mtd_info *mtd; > struct resource *res; > char *resname; > int ret; > @@ -647,10 +647,6 @@ static int ebu_nand_probe(struct platform_device *pdev) > ebu_host->ebu + EBU_ADDR_SEL(cs)); > > nand_set_flash_node(&ebu_host->chip, dev->of_node); > - if (!mtd->name) { > - dev_err(ebu_host->dev, "NAND label property is mandatory\n"); > - return -EINVAL; > - } This is valid code, it's best to use a label = "my-storage"; property in your NAND DT node. Then mtd->name will be updated by nand_set_flash_node(). Thanks, Miquèl