Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4984557yba; Mon, 13 May 2019 03:23:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3ExYIuvPMFRzNXp4E/K0xK6wGShgMYmSDuyU0I5980wL1vvWL/cvNroKQ1m46zWsy36R0 X-Received: by 2002:aa7:8b57:: with SMTP id i23mr10556527pfd.54.1557742999380; Mon, 13 May 2019 03:23:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557742999; cv=none; d=google.com; s=arc-20160816; b=mWdYqQyLT991KwFUlpKAU+d7dnoCmBJA8NKlagXXRSM6YNgiJ0c/7Kz9Ye5BlS2tAz ziWPcGXrfZ+mCZtXVlZB1gYIjGReq8KPvmHJOn64XIyM64cFxnssUIdEfj/D3R5ZZXMg dVslSHBCa9hDo/wK32c0R69EPUqmPlpZfO5x395n4VuIA45yRp5HPK1CkKbRiVu6hACD AmmkXGauc5aPFBw3+gvpMvZYxOy2wLNmWahimIj/BM2bMkfgx6kHddlW4cx+Y54a6tYz gCfPrUJGswoBYIaUoIJ3nOAwqFq/e+WPnA4+VpFvXJlraDxcfY2iTsUlQi5YGb7Hzq10 Wnsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=tht41nuRfh+eKCr6DXy8+k+oe5r20LxThYteOOy7d94=; b=Mwz500dLBX0z05QDQNxFjGTIYebXBc82OENHipBIPVrbZmJQMcRtSA+W7h2quL7dN9 axXPLbNDfLz5EmY/4S2dHYFGmndV6Yq0cmapjrZVAZdXlMP+/pJJcJDOeqFMUxvxTOSv xNQo/i6CaF0jRvgy7Vumz4w4ZoGUPLzbvSEAfM1aUTbh79iTlb6/P6kbTgHmH0OWDWLp mP16DYQ6kBQN1i56cCPVHG9J7ZCN6rS+7BDu+1TquCBhDC1jeG6HGLzhpJc87ikUgcbF vmxXm6G4dCSxvsquDeYmEDamcoLtp1TGjdLKvZeZ8W2PqryN65ysQ4xO8lFFpj70YNsC vHyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 21si4367797pfo.251.2019.05.13.03.23.02; Mon, 13 May 2019 03:23:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728623AbfEMJlI (ORCPT + 99 others); Mon, 13 May 2019 05:41:08 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:36057 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726274AbfEMJlI (ORCPT ); Mon, 13 May 2019 05:41:08 -0400 X-Originating-IP: 83.204.64.206 Received: from windsurf.home (anantes-658-1-8-206.w83-204.abo.wanadoo.fr [83.204.64.206]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 607CE1BF20E; Mon, 13 May 2019 09:41:01 +0000 (UTC) Date: Mon, 13 May 2019 11:40:59 +0200 From: Thomas Petazzoni To: masonccyang@mxic.com.tw Cc: bbrezillon@kernel.org, computersforpeace@gmail.com, dwmw2@infradead.org, juliensu@mxic.com.tw, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, marek.vasut@gmail.com, miquel.raynal@bootlin.com, richard@nod.at Subject: Re: [PATCH v1] mtd: rawnand: Add Macronix NAND read retry support Message-ID: <20190513114059.3934b0bb@windsurf.home> In-Reply-To: References: <1557474062-4949-1-git-send-email-masonccyang@mxic.com.tw> <20190510153704.33de9568@windsurf.home> Organization: Bootlin X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Mon, 13 May 2019 15:37:39 +0800 masonccyang@mxic.com.tw wrote: > ------------------------------------------------------------------- > static void macronix_nand_onfi_init(struct nand_chip *chip) > { > struct nand_parameters *p = &chip->parameters; > struct nand_onfi_vendor_macronix *mxic = (void > *)p->onfi->vendor; Why cast to void*, instead of casting directly to struct nand_onfi_vendor_macronix * ? Also, you are dereferencing p->info before checking whether it's NULL or not. > if (!p->onfi || > ((mxic->reliability_func & MACRONIX_READ_RETRY_BIT) == 0)) > return; So, the code should be: struct nand_onfi_vendor_macronix *mxic; if (!p->onfi) return; mxic = (struct nand_onfi_vendor_macronix *) p->info->vendor; if ((mxic->reliability_func & MACRONIX_READ_RETRY_BIT) == 0) return; Best regards, Thomas -- Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com