mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: cpumask: make cpumask.h eat its own dogfood.
       [not found] <200901032108.n03L8QiP005724@hera.kernel.org>
@ 2009-01-15 21:48 ` Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2009-01-15 21:48 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel

On Sat, 3 Jan 2009 21:08:26 GMT
Linux Kernel Mailing List <linux-kernel@vger.kernel.org> wrote:

> Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ae7a47e72e1a0b5e2b46d1596bc2c22942a73023
> Commit:     ae7a47e72e1a0b5e2b46d1596bc2c22942a73023
> Parent:     b3199c025d1646e25e7d1d640dd605db251dccf8
> Author:     Rusty Russell <rusty@rustcorp.com.au>
> AuthorDate: Tue Dec 30 09:05:15 2008 +1030
> Committer:  Rusty Russell <rusty@rustcorp.com.au>
> CommitDate: Tue Dec 30 09:05:15 2008 +1030
> 
>     cpumask: make cpumask.h eat its own dogfood.
>     
>     Changes:
>     1) cpumask_t to struct cpumask,
>     2) cpus_weight_nr to cpumask_weight,
>     3) cpu_isset to cpumask_test_cpu,
>     4) ->bits to cpumask_bits()
>     5) cpu_*_map to cpu_*_mask.
>     6) for_each_cpu_mask_nr to for_each_cpu

I can't find this commit (by this title) on linux-kernel to reply to. 
Please try real hard to prevent this from occurring?

> -#define num_online_cpus()	cpus_weight_nr(cpu_online_map)
> -#define num_possible_cpus()	cpus_weight_nr(cpu_possible_map)
> -#define num_present_cpus()	cpus_weight_nr(cpu_present_map)
> -#define cpu_online(cpu)		cpu_isset((cpu), cpu_online_map)
> -#define cpu_possible(cpu)	cpu_isset((cpu), cpu_possible_map)
> -#define cpu_present(cpu)	cpu_isset((cpu), cpu_present_map)
> -#define cpu_active(cpu)		cpu_isset((cpu), cpu_active_map)
> +#define num_online_cpus()	cpumask_weight(cpu_online_mask)
> +#define num_possible_cpus()	cpumask_weight(cpu_possible_mask)
> +#define num_present_cpus()	cpumask_weight(cpu_present_mask)
> +#define cpu_online(cpu)		cpumask_test_cpu((cpu), cpu_online_mask)
> +#define cpu_possible(cpu)	cpumask_test_cpu((cpu), cpu_possible_mask)
> +#define cpu_present(cpu)	cpumask_test_cpu((cpu), cpu_present_mask)
> +#define cpu_active(cpu)		cpumask_test_cpu((cpu), cpu_active_mask)

These alterations secretly changed the return type of these macros from
"int" to "unsigned int".

This has caused a couple of compile-time warnings from min() and max().
Hopefully there won't be any more serious fallout.

I think it's a _good_ change - there's no logical reason for these
macros to return negative numbers.  But I suspect it was an accidental
change.

But everything is now all screwed up.  cpumask_weight() and friends
return `unsigned int', but cpus_weight() and bitmap_weight() return
`int'.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-15 21:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200901032108.n03L8QiP005724@hera.kernel.org>
2009-01-15 21:48 ` cpumask: make cpumask.h eat its own dogfood Andrew Morton

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

Powered by JetHome