mfd: off by one calculating size
Subsystems (2)
PATCH 1/1 mfd: off by one calculating size
I'm pretty sure that it should be + 1 here. It's an off by one, because we start counting at zero.
---
Found by a static checker and untested. Please review carefully.
drivers/mfd/timberdale.h +1 -1
@@ -66,7 +66,7 @@#define CHIPCTLOFFSET 0x800#define CHIPCTLEND 0x8ff -#define CHIPCTLSIZE (CHIPCTLEND - CHIPCTLOFFSET) +#define CHIPCTLSIZE (CHIPCTLEND - CHIPCTLOFFSET + 1)#define INTCOFFSET 0xc00#define INTCEND 0xfff
Quoted 2 lines · Dan Carpenter
I'm pretty sure that it should be + 1 here. It's an off by one, because we start counting at zero.
You are completely right, fortunately we don't access the last register.
Quoted 1 line
Signed-off-by Dan Carpenter<[email protected]>
Quoted 8 lines
---
Found by a static checker and untested. Please review carefully.drivers/mfd/timberdale.h +0
-0
drivers/mfd/timberdale.h line 72
Quoted 8 lines
drivers/mfd/timberdale.h +1
-1@@ -66,7 +66,7 @@#define CHIPCTLOFFSET 0x800#define CHIPCTLEND 0x8ff -#define CHIPCTLSIZE (CHIPCTLEND - CHIPCTLOFFSET) +#define CHIPCTLSIZE (CHIPCTLEND - CHIPCTLOFFSET + 1)#define INTCOFFSET 0xc00#define INTCEND 0xfff
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Dan,
Quoted 2 lines · Dan Carpenter
I'm pretty sure that it should be + 1 here. It's an off by one, because we start counting at zero.
Thanks Dan, patch applied to my for-next branch.
Cheers,
Samuel.
Quoted 17 lines
Signed-off-by Dan Carpenter <[email protected]>---
Found by a static checker and untested. Please review carefully.drivers/mfd/timberdale.h +1
-1@@ -66,7 +66,7 @@#define CHIPCTLOFFSET 0x800#define CHIPCTLEND 0x8ff -#define CHIPCTLSIZE (CHIPCTLEND - CHIPCTLOFFSET) +#define CHIPCTLSIZE (CHIPCTLEND - CHIPCTLOFFSET + 1)#define INTCOFFSET 0xc00#define INTCEND 0xfff
Signature · 2 lines
Intel Open Source Technology Centre http://oss.intel.com/