lkml.org 
[lkml]   [2010]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] 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.

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
Found by a static checker and untested. Please review carefully.

diff --git a/drivers/mfd/timberdale.h b/drivers/mfd/timberdale.h
index 8d27ffa..902c451 100644
--- a/drivers/mfd/timberdale.h
+++ b/drivers/mfd/timberdale.h
@@ -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

\
 
 \ /
  Last update: 2010-03-22 13:15    [W:0.065 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site