2008-08-18 21:40:26

by Hiroshi Shimamoto

[permalink] [raw]
Subject: [PATCH -tip] rcuclassic: fix compiler warning

From: Hiroshi Shimamoto <[email protected]>

CC kernel/rcuclassic.o
kernel/rcuclassic.c: In function 'rcu_init_percpu_data':
kernel/rcuclassic.c:705: warning: comparison of distinct pointer types lacks a cast
kernel/rcuclassic.c:713: warning: comparison of distinct pointer types lacks a cast

flags should be unsigned long.

Signed-off-by: Hiroshi Shimamoto <[email protected]>
---
kernel/rcuclassic.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/rcuclassic.c b/kernel/rcuclassic.c
index fb1f1cc..86ff6d6 100644
--- a/kernel/rcuclassic.c
+++ b/kernel/rcuclassic.c
@@ -700,7 +700,7 @@ void rcu_check_callbacks(int cpu, int user)
static void rcu_init_percpu_data(int cpu, struct rcu_ctrlblk *rcp,
struct rcu_data *rdp)
{
- long flags;
+ unsigned long flags;

spin_lock_irqsave(&rcp->lock, flags);
memset(rdp, 0, sizeof(*rdp));
--
1.5.6


2008-08-18 23:28:43

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH -tip] rcuclassic: fix compiler warning

On Mon, Aug 18, 2008 at 02:39:21PM -0700, Hiroshi Shimamoto wrote:
> From: Hiroshi Shimamoto <[email protected]>
>
> CC kernel/rcuclassic.o
> kernel/rcuclassic.c: In function 'rcu_init_percpu_data':
> kernel/rcuclassic.c:705: warning: comparison of distinct pointer types lacks a cast
> kernel/rcuclassic.c:713: warning: comparison of distinct pointer types lacks a cast
>
> flags should be unsigned long.

You beat me to it!

Acked-by: Paul E. McKenney <[email protected]>

> Signed-off-by: Hiroshi Shimamoto <[email protected]>
> ---
> kernel/rcuclassic.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/rcuclassic.c b/kernel/rcuclassic.c
> index fb1f1cc..86ff6d6 100644
> --- a/kernel/rcuclassic.c
> +++ b/kernel/rcuclassic.c
> @@ -700,7 +700,7 @@ void rcu_check_callbacks(int cpu, int user)
> static void rcu_init_percpu_data(int cpu, struct rcu_ctrlblk *rcp,
> struct rcu_data *rdp)
> {
> - long flags;
> + unsigned long flags;
>
> spin_lock_irqsave(&rcp->lock, flags);
> memset(rdp, 0, sizeof(*rdp));
> --
> 1.5.6
>

2008-08-26 18:58:50

by Hiroshi Shimamoto

[permalink] [raw]
Subject: Re: [PATCH -tip] rcuclassic: fix compiler warning

Paul E. McKenney wrote:
> On Mon, Aug 18, 2008 at 02:39:21PM -0700, Hiroshi Shimamoto wrote:
>> From: Hiroshi Shimamoto <[email protected]>
>>
>> CC kernel/rcuclassic.o
>> kernel/rcuclassic.c: In function 'rcu_init_percpu_data':
>> kernel/rcuclassic.c:705: warning: comparison of distinct pointer types lacks a cast
>> kernel/rcuclassic.c:713: warning: comparison of distinct pointer types lacks a cast
>>
>> flags should be unsigned long.
>
> You beat me to it!
>
> Acked-by: Paul E. McKenney <[email protected]>

Hi Ingo, could you please apply this?

thanks,
Hiroshi Shimamoto

2008-08-27 07:29:17

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH -tip] rcuclassic: fix compiler warning


* Hiroshi Shimamoto <[email protected]> wrote:

> Paul E. McKenney wrote:
> > On Mon, Aug 18, 2008 at 02:39:21PM -0700, Hiroshi Shimamoto wrote:
> >> From: Hiroshi Shimamoto <[email protected]>
> >>
> >> CC kernel/rcuclassic.o
> >> kernel/rcuclassic.c: In function 'rcu_init_percpu_data':
> >> kernel/rcuclassic.c:705: warning: comparison of distinct pointer types lacks a cast
> >> kernel/rcuclassic.c:713: warning: comparison of distinct pointer types lacks a cast
> >>
> >> flags should be unsigned long.
> >
> > You beat me to it!
> >
> > Acked-by: Paul E. McKenney <[email protected]>
>
> Hi Ingo, could you please apply this?

hm, the fix got lost due to a revert+reapply - i've applied your fix
now, thanks for keeping an eye on it.

Ingo