Skip to contentSkip to conversation

mtd: nand: use more reasonable integer types

PATCH Applied Artem Bityutskiy 1 participant 2 messages Mar 13, 2013 – Mar 14, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: nand: use more reasonable integer types

From: Artem Bityutskiy <[email protected]>

Use 'unsigned int' instead of 'unsigned long' in the NAND chip description data structure, because 32-bits is more than enough for our purposes. We do not need 64-bits, which is what we end up on 64-bit architectures. We declare many instances of this data structure, so this should help saving some amount of memory.

---
 include/linux/mtd/nand.h |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
include/linux/mtd/nand.h +5 -5
index 0c40beb..e2c7173 100644
@@ -578,8 +578,8 @@ struct nand_chip {
  * @pagesize: size of the NAND page in bytes; if 0, then the real page size (as
  *            well as the eraseblock size) is determined from the extended NAND
  *            chip ID array)
- * @erasesize: eraseblock size in bytes (determined from the extended ID if 0)
  * @chipsize: total chip size in MiB
+ * @erasesize: eraseblock size in bytes (determined from the extended ID if 0)
  * @options: stores various chip bit options
  */
 struct nand_flash_dev {
@@ -591,10 +591,10 @@ struct nand_flash_dev {
 		};
 		uint8_t id[8];
 	};
-	unsigned long pagesize;
-	unsigned long chipsize;
-	unsigned long erasesize;
-	unsigned long options;
+	unsigned int pagesize;
+	unsigned int chipsize;
+	unsigned int erasesize;
+	unsigned int options;
 };
 
 /**
Signature · 1 line
1.7.10.4
author Applied
#1 lore raw
Quoted 9 lines · Artem Bityutskiy

From: Artem Bityutskiy <[email protected]>

Use 'unsigned int' instead of 'unsigned long' in the NAND chip description data structure, because 32-bits is more than enough for our purposes. We do not need 64-bits, which is what we end up on 64-bit architectures. We declare many instances of this data structure, so this should help saving some amount of memory.

Pushed to l2-mtd.git.

Signature · 2 lines
Best Regards,
Artem Bityutskiy