[PATCH v2] mtd: rawnand: meson: replace integer consts with proper defines

Arseniy Krasnov AVKrasnov at sberdevices.ru
Wed Jun 7 21:36:44 PDT 2023


Add defines for column address. It makes driver more readable, because
bitwise OR with 0 looks useless.

Suggested-by: Liang Yang <liang.yang at amlogic.com>
Signed-off-by: Arseniy Krasnov <AVKrasnov at sberdevices.ru>
---
 Changelog:
  v1 -> v2:
   * Use defines with zero values instead of dropping both operations in
     v1.

 drivers/mtd/nand/raw/meson_nand.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
index 0154131e1d54..9034b3ca9e5b 100644
--- a/drivers/mtd/nand/raw/meson_nand.c
+++ b/drivers/mtd/nand/raw/meson_nand.c
@@ -109,6 +109,9 @@
 
 #define PER_INFO_BYTE		8
 
+#define NFC_COLUMN_ADDR_0	0
+#define NFC_COLUMN_ADDR_1	0
+
 struct meson_nfc_nand_chip {
 	struct list_head node;
 	struct nand_chip nand;
@@ -672,12 +675,12 @@ static int meson_nfc_rw_cmd_prepare_and_execute(struct nand_chip *nand,
 	cmd0 = in ? NAND_CMD_READ0 : NAND_CMD_SEQIN;
 	nfc->cmdfifo.rw.cmd0 = cs | NFC_CMD_CLE | cmd0;
 
-	addrs[0] = cs | NFC_CMD_ALE | 0;
+	addrs[0] = cs | NFC_CMD_ALE | NFC_COLUMN_ADDR_0;
 	if (mtd->writesize <= 512) {
 		cmd_num--;
 		row_start = 1;
 	} else {
-		addrs[1] = cs | NFC_CMD_ALE | 0;
+		addrs[1] = cs | NFC_CMD_ALE | NFC_COLUMN_ADDR_1;
 		row_start = 2;
 	}
 
-- 
2.35.0




More information about the linux-arm-kernel mailing list