Thread (22 messages) 22 messages, 2 authors, 2020-06-03

Re: [PATCH v9 4/9] mtd: rawnand: Use nanddev_get_ecc_requirements() when relevant

From: Miquel Raynal <miquel.raynal@bootlin.com>
Date: 2020-06-03 10:30:44

Boris Brezillon [off-list ref] wrote on Tue, 2 Jun
2020 18:00:16 +0200:
On Tue,  2 Jun 2020 16:31:19 +0200
Miquel Raynal [off-list ref] wrote:

quoted
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 1ce2cbe72e4c..e8e22d79f422 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -4725,6 +4725,9 @@ static inline bool is_full_id_nand(struct nand_flash_dev *type)
 static bool find_full_id_nand(struct nand_chip *chip,
 			      struct nand_flash_dev *type)
 {
+	struct nand_device *base = &chip->base;
+	struct nand_ecc_props *requirements =
+		(struct nand_ecc_props *)nanddev_get_ecc_requirements(base);  
Ouch, that sounds wrong. How about introducing a
nanddev_set_ecc_requirements() helper instead? The same applies to all
places where you have this cast.
A setter helper is very helpful here, I should have done that in the
first place.
quoted
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index e572d1600f63..0b89da54bef2 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -527,7 +527,7 @@ nanddev_get_ecc_conf(struct nand_device *nand)
  *                                  device
  * @nand: NAND device
  */
-const struct nand_ecc_props *
+static inline const struct nand_ecc_props *
 nanddev_get_ecc_requirements(struct nand_device *nand)  
Looks like this should be squashed in patch 2.
quoted
 {
 	return &nand->eccreq;  
Oh right.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help