All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] signedness of cpu variables
@ 2007-02-06 19:32 Thomas Hisch
  2007-02-06 22:25 ` Randy Dunlap
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Thomas Hisch @ 2007-02-06 19:32 UTC (permalink / raw)
  To: kernel-janitors

i digged into the kernel source and found a lot of signed int cpu variables.
shouldn't they be replaced by unsigned ints ??

for example everywhere in kernel/cpu.c cpu variables are unsigned except in
check_for_tasks(int cpu). are there any reasons for the signed int parameter
of this  particular function ??

any thoughts ??
is this sth. for the kernel-janitors ?

regards
Thomas Hisch

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 7406fe6..b0d4fbd 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -87,7 +87,7 @@ void unregister_cpu_notifier(struct notifier_block *nb)
 }
 EXPORT_SYMBOL(unregister_cpu_notifier);

-static inline void check_for_tasks(int cpu)
+static inline void check_for_tasks(unsigned int cpu)
 {
        struct task_struct *p;

--
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] signedness of cpu variables
  2007-02-06 19:32 [KJ] signedness of cpu variables Thomas Hisch
@ 2007-02-06 22:25 ` Randy Dunlap
  2007-02-07 10:41 ` walter harms
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Randy Dunlap @ 2007-02-06 22:25 UTC (permalink / raw)
  To: kernel-janitors

On Tue, 6 Feb 2007 20:32:29 +0100 Thomas Hisch wrote:

> i digged into the kernel source and found a lot of signed int cpu variables.
> shouldn't they be replaced by unsigned ints ??
> 
> for example everywhere in kernel/cpu.c cpu variables are unsigned except in
> check_for_tasks(int cpu). are there any reasons for the signed int parameter
> of this  particular function ??
> 
> any thoughts ??
> is this sth. for the kernel-janitors ?

This one makes sense.  Others would need their own evaluations.

> regards
> Thomas Hisch
> 
> diff --git a/kernel/cpu.c b/kernel/cpu.c
> index 7406fe6..b0d4fbd 100644
> --- a/kernel/cpu.c
> +++ b/kernel/cpu.c
> @@ -87,7 +87,7 @@ void unregister_cpu_notifier(struct notifier_block *nb)
>  }
>  EXPORT_SYMBOL(unregister_cpu_notifier);
> 
> -static inline void check_for_tasks(int cpu)
> +static inline void check_for_tasks(unsigned int cpu)
>  {
>         struct task_struct *p;


---
~Randy
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] signedness of cpu variables
  2007-02-06 19:32 [KJ] signedness of cpu variables Thomas Hisch
  2007-02-06 22:25 ` Randy Dunlap
@ 2007-02-07 10:41 ` walter harms
  2007-02-07 14:07 ` Thomas Hisch
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: walter harms @ 2007-02-07 10:41 UTC (permalink / raw)
  To: kernel-janitors

if this is intended, someone could add a remark about it ?

re,
 wh


Randy Dunlap wrote:
> On Tue, 6 Feb 2007 20:32:29 +0100 Thomas Hisch wrote:
> 
>> i digged into the kernel source and found a lot of signed int cpu variables.
>> shouldn't they be replaced by unsigned ints ??
>>
>> for example everywhere in kernel/cpu.c cpu variables are unsigned except in
>> check_for_tasks(int cpu). are there any reasons for the signed int parameter
>> of this  particular function ??
>>
>> any thoughts ??
>> is this sth. for the kernel-janitors ?
> 
> This one makes sense.  Others would need their own evaluations.
> 
>> regards
>> Thomas Hisch
>>
>> diff --git a/kernel/cpu.c b/kernel/cpu.c
>> index 7406fe6..b0d4fbd 100644
>> --- a/kernel/cpu.c
>> +++ b/kernel/cpu.c
>> @@ -87,7 +87,7 @@ void unregister_cpu_notifier(struct notifier_block *nb)
>>  }
>>  EXPORT_SYMBOL(unregister_cpu_notifier);
>>
>> -static inline void check_for_tasks(int cpu)
>> +static inline void check_for_tasks(unsigned int cpu)
>>  {
>>         struct task_struct *p;
> 
> 
> ---
> ~Randy
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/kernel-janitors
> 
> 
> 
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] signedness of cpu variables
  2007-02-06 19:32 [KJ] signedness of cpu variables Thomas Hisch
  2007-02-06 22:25 ` Randy Dunlap
  2007-02-07 10:41 ` walter harms
@ 2007-02-07 14:07 ` Thomas Hisch
  2007-02-07 14:16 ` Thomas Hisch
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Thomas Hisch @ 2007-02-07 14:07 UTC (permalink / raw)
  To: kernel-janitors

i did a new patch replacing signed int cpu and some signed int node
variables in arch/i386/kernel. i experienced that some of the function
prototypes are also used
by other architectures. do some archs need signed int cpus ? if yes,
is this whole replacing signed int stuff worth the effort ?

and what about the final type of the cpu variables - should we use one
of the u16,u32,.. typedefs for unsigned types, or should we stick with
unsigned int ?

regards
Thomas Hisch

On 2/7/07, walter harms <wharms@bfs.de> wrote:
> if this is intended, someone could add a remark about it ?
>
> re,
>  wh
>
>
> Randy Dunlap wrote:
> > On Tue, 6 Feb 2007 20:32:29 +0100 Thomas Hisch wrote:
> >
> >> i digged into the kernel source and found a lot of signed int cpu variables.
> >> shouldn't they be replaced by unsigned ints ??
> >>
> >> for example everywhere in kernel/cpu.c cpu variables are unsigned except in
> >> check_for_tasks(int cpu). are there any reasons for the signed int parameter
> >> of this  particular function ??
> >>
> >> any thoughts ??
> >> is this sth. for the kernel-janitors ?
> >
> > This one makes sense.  Others would need their own evaluations.
> >
> >> regards
> >> Thomas Hisch
> >>
> >> diff --git a/kernel/cpu.c b/kernel/cpu.c
> >> index 7406fe6..b0d4fbd 100644
> >> --- a/kernel/cpu.c
> >> +++ b/kernel/cpu.c
> >> @@ -87,7 +87,7 @@ void unregister_cpu_notifier(struct notifier_block *nb)
> >>  }
> >>  EXPORT_SYMBOL(unregister_cpu_notifier);
> >>
> >> -static inline void check_for_tasks(int cpu)
> >> +static inline void check_for_tasks(unsigned int cpu)
> >>  {
> >>         struct task_struct *p;
> >
> >
> > ---
> > ~Randy
> > _______________________________________________
> > Kernel-janitors mailing list
> > Kernel-janitors@lists.osdl.org
> > https://lists.osdl.org/mailman/listinfo/kernel-janitors
> >
> >
> >
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/kernel-janitors
>
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] signedness of cpu variables
  2007-02-06 19:32 [KJ] signedness of cpu variables Thomas Hisch
                   ` (2 preceding siblings ...)
  2007-02-07 14:07 ` Thomas Hisch
@ 2007-02-07 14:16 ` Thomas Hisch
  2007-02-07 16:09 ` Randy Dunlap
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Thomas Hisch @ 2007-02-07 14:16 UTC (permalink / raw)
  To: kernel-janitors

i did a new patch replacing signed int cpu and some signed int node
variables in arch/i386/kernel. i experienced that some of the function
prototypes are also used
by other architectures. do some archs need signed int cpus ? if yes,
is this whole replacing signed int stuff worth the effort ?

and what about the final type of the cpu variables - should we use one
of the u16,u32,.. typedefs for unsigned types, or should we stick with
unsigned int ?

regards
Thomas Hisch

On 2/7/07, walter harms <wharms@bfs.de> wrote:
> if this is intended, someone could add a remark about it ?
>
> re,
>  wh
>
>
> Randy Dunlap wrote:
> > On Tue, 6 Feb 2007 20:32:29 +0100 Thomas Hisch wrote:
> >
> >> i digged into the kernel source and found a lot of signed int cpu variables.
> >> shouldn't they be replaced by unsigned ints ??
> >>
> >> for example everywhere in kernel/cpu.c cpu variables are unsigned except in
> >> check_for_tasks(int cpu). are there any reasons for the signed int parameter
> >> of this  particular function ??
> >>
> >> any thoughts ??
> >> is this sth. for the kernel-janitors ?
> >
> > This one makes sense.  Others would need their own evaluations.
> >
> >> regards
> >> Thomas Hisch
> >>
> >> diff --git a/kernel/cpu.c b/kernel/cpu.c
> >> index 7406fe6..b0d4fbd 100644
> >> --- a/kernel/cpu.c
> >> +++ b/kernel/cpu.c
> >> @@ -87,7 +87,7 @@ void unregister_cpu_notifier(struct notifier_block *nb)
> >>  }
> >>  EXPORT_SYMBOL(unregister_cpu_notifier);
> >>
> >> -static inline void check_for_tasks(int cpu)
> >> +static inline void check_for_tasks(unsigned int cpu)
> >>  {
> >>         struct task_struct *p;
> >
> >
> > ---
> > ~Randy
> > _______________________________________________
> > Kernel-janitors mailing list
> > Kernel-janitors@lists.osdl.org
> > https://lists.osdl.org/mailman/listinfo/kernel-janitors
> >
> >
> >
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/kernel-janitors
>
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] signedness of cpu variables
  2007-02-06 19:32 [KJ] signedness of cpu variables Thomas Hisch
                   ` (3 preceding siblings ...)
  2007-02-07 14:16 ` Thomas Hisch
@ 2007-02-07 16:09 ` Randy Dunlap
  2007-02-07 16:53 ` Randy Dunlap
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Randy Dunlap @ 2007-02-07 16:09 UTC (permalink / raw)
  To: kernel-janitors

On Wed, 07 Feb 2007 11:41:19 +0100 walter harms wrote:

> if this is intended, someone could add a remark about it ?
> 

If what is intended?  and please use reply-to-all.

> 
> Randy Dunlap wrote:
> > On Tue, 6 Feb 2007 20:32:29 +0100 Thomas Hisch wrote:
> > 
> >> i digged into the kernel source and found a lot of signed int cpu variables.
> >> shouldn't they be replaced by unsigned ints ??
> >>
> >> for example everywhere in kernel/cpu.c cpu variables are unsigned except in
> >> check_for_tasks(int cpu). are there any reasons for the signed int parameter
> >> of this  particular function ??
> >>
> >> any thoughts ??
> >> is this sth. for the kernel-janitors ?
> > 
> > This one makes sense.  Others would need their own evaluations.
> > 
> >> regards
> >> Thomas Hisch
> >>
> >> diff --git a/kernel/cpu.c b/kernel/cpu.c
> >> index 7406fe6..b0d4fbd 100644
> >> --- a/kernel/cpu.c
> >> +++ b/kernel/cpu.c
> >> @@ -87,7 +87,7 @@ void unregister_cpu_notifier(struct notifier_block *nb)
> >>  }
> >>  EXPORT_SYMBOL(unregister_cpu_notifier);
> >>
> >> -static inline void check_for_tasks(int cpu)
> >> +static inline void check_for_tasks(unsigned int cpu)
> >>  {
> >>         struct task_struct *p;
> > 
> > 
> > ---

---
~Randy
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] signedness of cpu variables
  2007-02-06 19:32 [KJ] signedness of cpu variables Thomas Hisch
                   ` (4 preceding siblings ...)
  2007-02-07 16:09 ` Randy Dunlap
@ 2007-02-07 16:53 ` Randy Dunlap
  2007-02-08  6:19 ` Alexey Dobriyan
  2007-02-08 11:11 ` walter harms
  7 siblings, 0 replies; 9+ messages in thread
From: Randy Dunlap @ 2007-02-07 16:53 UTC (permalink / raw)
  To: kernel-janitors

On Wed, 7 Feb 2007 15:16:54 +0100 Thomas Hisch wrote:

> i did a new patch replacing signed int cpu and some signed int node
> variables in arch/i386/kernel. i experienced that some of the function
> prototypes are also used
> by other architectures. do some archs need signed int cpus ? if yes,
> is this whole replacing signed int stuff worth the effort ?

Can't say for sure, but I don't see why any would need signed int cpu.

> and what about the final type of the cpu variables - should we use one
> of the u16,u32,.. typedefs for unsigned types, or should we stick with
> unsigned int ?

Just stick to non-typedefs (unsigned int).  Unless that causes
other problems...

> regards
> Thomas Hisch
> 
> On 2/7/07, walter harms <wharms@bfs.de> wrote:
> > if this is intended, someone could add a remark about it ?
> >
> > re,
> >  wh
> >
> >
> > Randy Dunlap wrote:
> > > On Tue, 6 Feb 2007 20:32:29 +0100 Thomas Hisch wrote:
> > >
> > >> i digged into the kernel source and found a lot of signed int cpu variables.
> > >> shouldn't they be replaced by unsigned ints ??
> > >>
> > >> for example everywhere in kernel/cpu.c cpu variables are unsigned except in
> > >> check_for_tasks(int cpu). are there any reasons for the signed int parameter
> > >> of this  particular function ??
> > >>
> > >> any thoughts ??
> > >> is this sth. for the kernel-janitors ?
> > >
> > > This one makes sense.  Others would need their own evaluations.
> > >
> > >> regards
> > >> Thomas Hisch
> > >>
> > >> diff --git a/kernel/cpu.c b/kernel/cpu.c
> > >> index 7406fe6..b0d4fbd 100644
> > >> --- a/kernel/cpu.c
> > >> +++ b/kernel/cpu.c
> > >> @@ -87,7 +87,7 @@ void unregister_cpu_notifier(struct notifier_block *nb)
> > >>  }
> > >>  EXPORT_SYMBOL(unregister_cpu_notifier);
> > >>
> > >> -static inline void check_for_tasks(int cpu)
> > >> +static inline void check_for_tasks(unsigned int cpu)
> > >>  {
> > >>         struct task_struct *p;
> > >
> > >
> > > ---

---
~Randy
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] signedness of cpu variables
  2007-02-06 19:32 [KJ] signedness of cpu variables Thomas Hisch
                   ` (5 preceding siblings ...)
  2007-02-07 16:53 ` Randy Dunlap
@ 2007-02-08  6:19 ` Alexey Dobriyan
  2007-02-08 11:11 ` walter harms
  7 siblings, 0 replies; 9+ messages in thread
From: Alexey Dobriyan @ 2007-02-08  6:19 UTC (permalink / raw)
  To: kernel-janitors

On Tue, Feb 06, 2007 at 02:25:44PM -0800, Randy Dunlap wrote:
> On Tue, 6 Feb 2007 20:32:29 +0100 Thomas Hisch wrote:
> 
> > i digged into the kernel source and found a lot of signed int cpu variables.
> > shouldn't they be replaced by unsigned ints ??
> > 
> > for example everywhere in kernel/cpu.c cpu variables are unsigned except in
> > check_for_tasks(int cpu). are there any reasons for the signed int parameter
> > of this  particular function ??
> > 
> > any thoughts ??
> > is this sth. for the kernel-janitors ?
> 
> This one makes sense.

And change to %u several lines below. :)

> Others would need their own evaluations.

> > --- a/kernel/cpu.c
> > +++ b/kernel/cpu.c
> > @@ -87,7 +87,7 @@ void unregister_cpu_notifier(struct notifier_block *nb)
> >  }
> >  EXPORT_SYMBOL(unregister_cpu_notifier);
> > 
> > -static inline void check_for_tasks(int cpu)
> > +static inline void check_for_tasks(unsigned int cpu)

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] signedness of cpu variables
  2007-02-06 19:32 [KJ] signedness of cpu variables Thomas Hisch
                   ` (6 preceding siblings ...)
  2007-02-08  6:19 ` Alexey Dobriyan
@ 2007-02-08 11:11 ` walter harms
  7 siblings, 0 replies; 9+ messages in thread
From: walter harms @ 2007-02-08 11:11 UTC (permalink / raw)
  To: kernel-janitors



Randy Dunlap wrote:
> On Wed, 07 Feb 2007 11:41:19 +0100 walter harms wrote:
> 
>> if this is intended, someone could add a remark about it ?
>>
> 
> If what is intended?  and please use reply-to-all.


ups wrong button :)

my point is:
if there is a reason to have a signed int cpu variable (instead
the 'normal' unsigned int) it should be documented WHY this is an
exception.

re,
 walter



> 
>> Randy Dunlap wrote:
>>> On Tue, 6 Feb 2007 20:32:29 +0100 Thomas Hisch wrote:
>>>
>>>> i digged into the kernel source and found a lot of signed int cpu variables.
>>>> shouldn't they be replaced by unsigned ints ??
>>>>
>>>> for example everywhere in kernel/cpu.c cpu variables are unsigned except in
>>>> check_for_tasks(int cpu). are there any reasons for the signed int parameter
>>>> of this  particular function ??
>>>>
>>>> any thoughts ??
>>>> is this sth. for the kernel-janitors ?
>>> This one makes sense.  Others would need their own evaluations.
>>>
>>>> regards
>>>> Thomas Hisch
>>>>
>>>> diff --git a/kernel/cpu.c b/kernel/cpu.c
>>>> index 7406fe6..b0d4fbd 100644
>>>> --- a/kernel/cpu.c
>>>> +++ b/kernel/cpu.c
>>>> @@ -87,7 +87,7 @@ void unregister_cpu_notifier(struct notifier_block *nb)
>>>>  }
>>>>  EXPORT_SYMBOL(unregister_cpu_notifier);
>>>>
>>>> -static inline void check_for_tasks(int cpu)
>>>> +static inline void check_for_tasks(unsigned int cpu)
>>>>  {
>>>>         struct task_struct *p;
>>>
>>> ---
> 
> ---
> ~Randy
> 
> 
> 
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2007-02-08 11:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-06 19:32 [KJ] signedness of cpu variables Thomas Hisch
2007-02-06 22:25 ` Randy Dunlap
2007-02-07 10:41 ` walter harms
2007-02-07 14:07 ` Thomas Hisch
2007-02-07 14:16 ` Thomas Hisch
2007-02-07 16:09 ` Randy Dunlap
2007-02-07 16:53 ` Randy Dunlap
2007-02-08  6:19 ` Alexey Dobriyan
2007-02-08 11:11 ` walter harms

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.