From: Andrew Morton <akpm@linux-foundation.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: cpumask: make cpumask.h eat its own dogfood.
Date: Thu, 15 Jan 2009 13:48:57 -0800 [thread overview]
Message-ID: <20090115134857.456a931e.akpm@linux-foundation.org> (raw)
In-Reply-To: <200901032108.n03L8QiP005724@hera.kernel.org>
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'.
parent reply other threads:[~2009-01-15 21:49 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <200901032108.n03L8QiP005724@hera.kernel.org>]
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=20090115134857.456a931e.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome