linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mach-davinci: signedness bug
@ 2010-11-15 18:40 Nicolas Kaiser
  2010-11-16  4:49 ` Nori, Sekhar
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Kaiser @ 2010-11-15 18:40 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Sekhar Nori, davinci-linux-open-source, kernel-janitors, linux-kernel

aemif_calc_rate() can return a negative error value, so all the
variables that get tested for this value need to be signed.

The maximum bit width of WSETUP(WSETUP_MAX) appears to be 30 bits
(0xf << 26). Using a signed instead of an unsigned integer
shouldn't make a difference here.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
---
 arch/arm/mach-davinci/aemif.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-davinci/aemif.c b/arch/arm/mach-davinci/aemif.c
index 9c3f500..1ce70a9 100644
--- a/arch/arm/mach-davinci/aemif.c
+++ b/arch/arm/mach-davinci/aemif.c
@@ -90,7 +90,7 @@ int davinci_aemif_setup_timing(struct davinci_aemif_timing *t,
 					void __iomem *base, unsigned cs)
 {
 	unsigned set, val;
-	unsigned ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup;
+	int ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup;
 	unsigned offset = A1CR_OFFSET + cs * 4;
 	struct clk *aemif_clk;
 	unsigned long clkrate;
-- 
1.7.2.2

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

* RE: [PATCH] mach-davinci: signedness bug
  2010-11-15 18:40 [PATCH] mach-davinci: signedness bug Nicolas Kaiser
@ 2010-11-16  4:49 ` Nori, Sekhar
  2010-11-19  0:28   ` Kevin Hilman
  0 siblings, 1 reply; 3+ messages in thread
From: Nori, Sekhar @ 2010-11-16  4:49 UTC (permalink / raw)
  To: Nicolas Kaiser, Kevin Hilman
  Cc: davinci-linux-open-source, kernel-janitors, linux-kernel

Hi Nicolas,

On Tue, Nov 16, 2010 at 00:10:28, Nicolas Kaiser wrote:
> aemif_calc_rate() can return a negative error value, so all the
> variables that get tested for this value need to be signed.
>
> The maximum bit width of WSETUP(WSETUP_MAX) appears to be 30 bits
> (0xf << 26). Using a signed instead of an unsigned integer
> shouldn't make a difference here.
>
> Signed-off-by: Nicolas Kaiser <nikai@nikai.net>

Thanks for the fix. You could use the subject:

"davinci: signedness bug in davinci_aemif_setup_timing()"

Other than that:

Acked-by: Sekhar Nori <nsekhar@ti.com>

Thanks,
Sekhar

> ---
>  arch/arm/mach-davinci/aemif.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/aemif.c b/arch/arm/mach-davinci/aemif.c
> index 9c3f500..1ce70a9 100644
> --- a/arch/arm/mach-davinci/aemif.c
> +++ b/arch/arm/mach-davinci/aemif.c
> @@ -90,7 +90,7 @@ int davinci_aemif_setup_timing(struct davinci_aemif_timing *t,
>                                       void __iomem *base, unsigned cs)
>  {
>       unsigned set, val;
> -     unsigned ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup;
> +     int ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup;
>       unsigned offset = A1CR_OFFSET + cs * 4;
>       struct clk *aemif_clk;
>       unsigned long clkrate;
> --
> 1.7.2.2
>


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

* Re: [PATCH] mach-davinci: signedness bug
  2010-11-16  4:49 ` Nori, Sekhar
@ 2010-11-19  0:28   ` Kevin Hilman
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Hilman @ 2010-11-19  0:28 UTC (permalink / raw)
  To: Nori, Sekhar
  Cc: Nicolas Kaiser, davinci-linux-open-source, kernel-janitors, linux-kernel

"Nori, Sekhar" <nsekhar@ti.com> writes:

> Hi Nicolas,
>
> On Tue, Nov 16, 2010 at 00:10:28, Nicolas Kaiser wrote:
>> aemif_calc_rate() can return a negative error value, so all the
>> variables that get tested for this value need to be signed.
>>
>> The maximum bit width of WSETUP(WSETUP_MAX) appears to be 30 bits
>> (0xf << 26). Using a signed instead of an unsigned integer
>> shouldn't make a difference here.
>>
>> Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
>
> Thanks for the fix. You could use the subject:
>
> "davinci: signedness bug in davinci_aemif_setup_timing()"
>
> Other than that:
>
> Acked-by: Sekhar Nori <nsekhar@ti.com>

Thanks, I fixed up the subject as Sekhar suggested.

Applied, queuing for 2.6.38.

Kevin


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

end of thread, other threads:[~2010-11-19  0:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-15 18:40 [PATCH] mach-davinci: signedness bug Nicolas Kaiser
2010-11-16  4:49 ` Nori, Sekhar
2010-11-19  0:28   ` Kevin Hilman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).