Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751980AbdFPFiz (ORCPT ); Fri, 16 Jun 2017 01:38:55 -0400 Received: from conssluserg-05.nifty.com ([210.131.2.90]:45186 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750983AbdFPFiy (ORCPT ); Fri, 16 Jun 2017 01:38:54 -0400 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com v5G5cd0d027422 X-Nifty-SrcIP: [209.85.213.174] MIME-Version: 1.0 In-Reply-To: <1497361550-8115-17-git-send-email-yamada.masahiro@socionext.com> References: <1497361550-8115-1-git-send-email-yamada.masahiro@socionext.com> <1497361550-8115-17-git-send-email-yamada.masahiro@socionext.com> From: Masahiro Yamada Date: Fri, 16 Jun 2017 14:38:37 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 16/16] mtd: nand: denali: avoid magic numbers and rename for clarification To: linux-mtd@lists.infradead.org Cc: Boris Brezillon , Cyrille Pitchen , Richard Weinberger , Marek Vasut , Masahiro Yamada , Artem Bityutskiy , Dinh Nguyen , Linux Kernel Mailing List , Enrico Jorns , Masami Hiramatsu , Chuanxiao Dong , Jassi Brar , Brian Norris , David Woodhouse Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1840 Lines: 56 2017-06-13 22:45 GMT+09:00 Masahiro Yamada : > Introduce some macros and helpers to avoid magic numbers and > rename macros/functions for clarification. > > - We see '| 2' in several places. This means Data Cycle in MAP11 mode. > The Denali User's Guide says bit[1:0] of MAP11 is like follows: > > b'00 = Command Cycle > b'01 = Address Cycle > b'10 = Data Cycle > > So, this commit added DENALI_MAP11_{CMD,ADDR,DATA} macros. > > - We see 'denali->flash_mem + 0x10' in several places, but 0x10 is a > magic number. Actually, this accesses the data port of the Host > Data/Command Interface. So, this commit added DENALI_HOST_DATA. > On the other hand, 'denali->flash_mem' gets access to the address > port, so DENALI_HOST_ADDR was also added. > > - We see 'index_addr(denali, cmd, 0x1)' in denali_erase(), but 0x1 > is a magic number. 0x1 means the erase operation. Replace 0x1 > with DENALI_ERASE. > > - Rename index_addr() to denali_host_write() for clarification > > - Denali User's Guide says MAP{00,01,10,11} for access mode. Match > the macros with terminology in the IP document. > > - Rename struct members as follows: > flash_bank -> active_bank (currently selected bank) > flash_reg -> reg (base address of registers) > flash_mem -> host (base address of host interface) > devnum -> devs_per_cs (devices connected in parallel) > bbtskipbytes -> oob_skip_bytes (number of bytes to skip in OOB) > > Signed-off-by: Masahiro Yamada > --- > > Changes in v7: None > Changes in v6: > - Newly added > > Changes in v5: None > Changes in v4: None > Changes in v3: None > Changes in v2: None Please let me update 18. (only typo fix) I sent v8 for this one. -- Best Regards Masahiro Yamada