public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] mfd: off by one calculating size
@ 2010-03-22 12:12 Dan Carpenter
  2010-03-22 12:37 ` Richard Röjfors
  2010-03-25 11:24 ` Samuel Ortiz
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2010-03-22 12:12 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: Mauro Carvalho Chehab, Richard Röjfors, linux-kernel,
	kernel-janitors

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] mfd: off by one calculating size
  2010-03-22 12:12 [patch] mfd: off by one calculating size Dan Carpenter
@ 2010-03-22 12:37 ` Richard Röjfors
  2010-03-25 11:24 ` Samuel Ortiz
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Röjfors @ 2010-03-22 12:37 UTC (permalink / raw)
  To: Dan Carpenter, Samuel Ortiz, Mauro Carvalho Chehab, linux-kernel,
	kernel-janitors

On 03/22/2010 01:12 PM, Dan Carpenter wrote:
> 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.

> Signed-off-by: Dan Carpenter<error27@gmail.com>

Acked-by: Richard Röjfors <richard.rojfors@pelagicore.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
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] mfd: off by one calculating size
  2010-03-22 12:12 [patch] mfd: off by one calculating size Dan Carpenter
  2010-03-22 12:37 ` Richard Röjfors
@ 2010-03-25 11:24 ` Samuel Ortiz
  1 sibling, 0 replies; 3+ messages in thread
From: Samuel Ortiz @ 2010-03-25 11:24 UTC (permalink / raw)
  To: Dan Carpenter, Mauro Carvalho Chehab, Richard Röjfors,
	linux-kernel, kernel-janitors

Hi Dan,

On Mon, Mar 22, 2010 at 03:12:42PM +0300, Dan Carpenter wrote:
> 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.


> 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

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-25 11:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-22 12:12 [patch] mfd: off by one calculating size Dan Carpenter
2010-03-22 12:37 ` Richard Röjfors
2010-03-25 11:24 ` Samuel Ortiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox