Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp28795yba; Tue, 14 May 2019 18:32:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfKXAjb3woCjUAUooLFxmmnchIAaj9ZedfG5Ce94EA2noBpzQnPwLF11tOEqjs6b5xQGv3 X-Received: by 2002:a62:56d9:: with SMTP id h86mr45700469pfj.195.1557883921589; Tue, 14 May 2019 18:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557883921; cv=none; d=google.com; s=arc-20160816; b=w6aRFxafEy2PYaBFTxFQCA9dPBOwHv2f2nveI/q4xca10gYjibuOd9+wa0LL6xx5kf IE+igM7iRtfpbkOKZ1Oz6U9btWZC1husADfs9BZlf2mDH5ZYeHP3h1EEX77cwO1qJL7B AoY65KZR13Du0IETiW0H6nVYv75V1M2U95fYXuZOXGzzS6tLM2T+AQvztcjjtnOpIwo7 CBExggQxovJyllKmXE6RqHdeP0Rdz5+LzIeVitDxAzTRmfIEYOzN+kG7EWbIiTUEEpTC H252AJ+AtgJHRJgWO87at9wvJiN8TUxp3YrnypllvdX6k8EkCRLxtpWVEuIdv5vXSDGt C9EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:from:message-id:mime-version:subject :cc:to:references:in-reply-to; bh=B5F7gmDDbbdxWM0TL5vXDOPAQZKbG0BTQTo5tCYDgME=; b=DzuYwyzfalfLt3l+lpVHVgH08xISEab/NbY6q5XA+ZGprG7HuCXt9JcUVzgwO2GBX2 XjiFgo9ynUNcb3YGwkkrz94W8f6qWeYs14ePDYBnNIdbCUqJEkbc1JYy1yu1sBWX4n7w k7A5TbEGMFUW5sCoSAGX23fHLMlmOn8kFgseiXQ8YTxmNnqJ+90bb2N+NL/oNtHoE0CH arDaXlUu5QXTnJPc+YzMKg+ypmE0yYcdOsmO28AgYJaQP5M3cVzNCGRwzfxSbRhUDfKp rLnGE5QYhAbVrtRwj3ygPBTpUdd18cibrMnDmflyn+Rfp4j9ie+HO3vJd4Rs6rYQu407 xLAQ== 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 68si487241pga.147.2019.05.14.18.31.46; Tue, 14 May 2019 18:32:01 -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 S1726657AbfEOBaK (ORCPT + 99 others); Tue, 14 May 2019 21:30:10 -0400 Received: from twhmllg3.macronix.com ([211.75.127.131]:60746 "EHLO TWHMLLG3.macronix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726567AbfEOBaG (ORCPT ); Tue, 14 May 2019 21:30:06 -0400 Received: from twhfmlp1.macronix.com (twhfm1p1.macronix.com [172.17.20.91]) by TWHMLLG3.macronix.com with ESMTP id x4F1U0ch051830; Wed, 15 May 2019 09:30:00 +0800 (GMT-8) (envelope-from masonccyang@mxic.com.tw) Received: from MXML06C.mxic.com.tw (mxml06c.mxic.com.tw [172.17.14.55]) by Forcepoint Email with ESMTP id A36C041D2DF341FE82B2; Wed, 15 May 2019 09:30:00 +0800 (CST) In-Reply-To: <20190514094100.34d2a6ba@windsurf.home> References: <1557474062-4949-1-git-send-email-masonccyang@mxic.com.tw> <20190510153704.33de9568@windsurf.home> <20190513114059.3934b0bb@windsurf.home> <20190514094100.34d2a6ba@windsurf.home> To: "Thomas Petazzoni" 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 MIME-Version: 1.0 X-KeepSent: 337888B3:25F9D561-482583FB:00070B62; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.3FP4 SHF90 June 10, 2013 Message-ID: From: masonccyang@mxic.com.tw Date: Wed, 15 May 2019 09:30:01 +0800 X-MIMETrack: Serialize by Router on MXML06C/TAIWAN/MXIC(Release 9.0.1FP10 HF265|July 25, 2018) at 2019/05/15 AM 09:30:00, Serialize complete at 2019/05/15 AM 09:30:00 Content-Type: text/plain; charset="US-ASCII" X-MAIL: TWHMLLG3.macronix.com x4F1U0ch051830 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, > > > > > ------------------------------------------------------------------- > > > > 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 * ? > > > > Due to got a warning: > > > > warning: initialization from incompatible pointer type > > struct nand_onfi_vendor_macronix *mxic = p->onfi->vendor; > > You didn't look at my code, I suggested: > > mxic = (struct nand_onfi_vendor_macronix *) p->info->vendor; Oops, sorry that I did not pay attention to it. Will patch it by your comments. static void macronix_nand_onfi_init(struct nand_chip *chip) { struct nand_parameters *p = &chip->parameters; struct nand_onfi_vendor_macronix *mxic; if (!p->onfi) return; mxic = (struct nand_onfi_vendor_macronix *) p->onfi->vendor; if ((mxic->reliability_func & MACRONIX_READ_RETRY_BIT) == 0) return; chip->read_retries = MACRONIX_READ_RETRY_MODE; chip->setup_read_retry = macronix_nand_setup_read_retry; if (p->supports_set_get_features) { bitmap_set(p->set_feature_list, ONFI_FEATURE_ADDR_READ_RETRY, 1); bitmap_set(p->get_feature_list, ONFI_FEATURE_ADDR_READ_RETRY, 1); } } thanks & best regards, Mason CONFIDENTIALITY NOTE: This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation. Macronix International Co., Ltd. ===================================================================== ============================================================================ CONFIDENTIALITY NOTE: This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation. Macronix International Co., Ltd. =====================================================================