summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-08-09 05:49:05 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2013-08-30 16:36:35 -0400
commitdaae74cad4bcd4566fcb82477e33c42bcdaa86e8 (patch)
treec17ee5583fc73f58b93fc4b918742bc38102e0d3 /drivers/mtd
parent7a96541a8e9fe720bec3900679ca514fefd2d516 (diff)
mtd: nand: silence some shift wrap warnings
There are static checkers which complain when we declare variables as 64 bit bitfields but only use the lower 32 bits because of shift wrapping. In this case "len" is declared as u64 as opposed to unsigned long or something which might be 32 bits. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/nand_base.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 8f04fb03f8ea..761ef2fa423e 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -108,13 +108,13 @@ static int check_offs_len(struct mtd_info *mtd,
108 int ret = 0; 108 int ret = 0;
109 109
110 /* Start address must align on block boundary */ 110 /* Start address must align on block boundary */
111 if (ofs & ((1 << chip->phys_erase_shift) - 1)) { 111 if (ofs & ((1ULL << chip->phys_erase_shift) - 1)) {
112 pr_debug("%s: unaligned address\n", __func__); 112 pr_debug("%s: unaligned address\n", __func__);
113 ret = -EINVAL; 113 ret = -EINVAL;
114 } 114 }
115 115
116 /* Length must align on block boundary */ 116 /* Length must align on block boundary */
117 if (len & ((1 << chip->phys_erase_shift) - 1)) { 117 if (len & ((1ULL << chip->phys_erase_shift) - 1)) {
118 pr_debug("%s: length not block aligned\n", __func__); 118 pr_debug("%s: length not block aligned\n", __func__);
119 ret = -EINVAL; 119 ret = -EINVAL;
120 } 120 }
@@ -394,7 +394,7 @@ static int nand_block_markbad_lowlevel(struct mtd_info *mtd, loff_t ofs)
394 memset(&einfo, 0, sizeof(einfo)); 394 memset(&einfo, 0, sizeof(einfo));
395 einfo.mtd = mtd; 395 einfo.mtd = mtd;
396 einfo.addr = ofs; 396 einfo.addr = ofs;
397 einfo.len = 1 << chip->phys_erase_shift; 397 einfo.len = 1ULL << chip->phys_erase_shift;
398 nand_erase_nand(mtd, &einfo, 0); 398 nand_erase_nand(mtd, &einfo, 0);
399 399
400 /* Write bad block marker to OOB */ 400 /* Write bad block marker to OOB */
@@ -2630,7 +2630,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
2630 } 2630 }
2631 2631
2632 /* Increment page address and decrement length */ 2632 /* Increment page address and decrement length */
2633 len -= (1 << chip->phys_erase_shift); 2633 len -= (1ULL << chip->phys_erase_shift);
2634 page += pages_per_block; 2634 page += pages_per_block;
2635 2635
2636 /* Check, if we cross a chip boundary */ 2636 /* Check, if we cross a chip boundary */