All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Richard Röjfors" <richard.rojfors@pelagicore.com>
To: Dan Carpenter <error27@gmail.com>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Mauro Carvalho Chehab <mchehab@redhat.com>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] mfd: off by one calculating size
Date: Mon, 22 Mar 2010 12:37:54 +0000	[thread overview]
Message-ID: <4BA764A2.6080400@pelagicore.com> (raw)
In-Reply-To: <20100322121242.GL21571@bicker>

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

WARNING: multiple messages have this Message-ID (diff)
From: "Richard Röjfors" <richard.rojfors@pelagicore.com>
To: Dan Carpenter <error27@gmail.com>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Mauro Carvalho Chehab <mchehab@redhat.com>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] mfd: off by one calculating size
Date: Mon, 22 Mar 2010 13:37:54 +0100	[thread overview]
Message-ID: <4BA764A2.6080400@pelagicore.com> (raw)
In-Reply-To: <20100322121242.GL21571@bicker>

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

  reply	other threads:[~2010-03-22 12:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-22 12:12 [patch] mfd: off by one calculating size Dan Carpenter
2010-03-22 12:12 ` Dan Carpenter
2010-03-22 12:37 ` Richard Röjfors [this message]
2010-03-22 12:37   ` Richard Röjfors
2010-03-25 11:24 ` Samuel Ortiz
2010-03-25 11:24   ` Samuel Ortiz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BA764A2.6080400@pelagicore.com \
    --to=richard.rojfors@pelagicore.com \
    --cc=error27@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.