Message ID | 1504001833-18097-3-git-send-email-LW@KARO-electronics.de |
---|---|
State | Accepted |
Headers | show |
Series | mtd: nand: fix regression introduced by splitting off manufacturer dependent code | expand |
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 94feece..2b05f42 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -1234,6 +1234,8 @@ int onfi_init_data_interface(struct nand_chip *chip, */ static inline bool nand_is_slc(struct nand_chip *chip) { + WARN(chip->bits_per_cell == 0, + "chip->bits_per_cell is used uninitialized\n"); return chip->bits_per_cell == 1; }
chip->bits_per_cell which is used to determine the NAND cell type (SLC/MLC) should always have a value != 0. Complain loudly if the value is 0 in nand_is_slc() to catch use before correct initialization. Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de> --- include/linux/mtd/rawnand.h | 2 ++ 1 file changed, 2 insertions(+)