From: Andrew Morton <akpm@linux-foundation.org>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: linux-kernel@vger.kernel.org, Paul Jackson <pj@sgi.com>
Subject: Re: [PATCH 1/5] Fix cpumask_scnprintf_len() misdesign
Date: Wed, 7 May 2008 14:35:37 -0700 [thread overview]
Message-ID: <20080507143537.94d744c5.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080507221450.GA14375@martell.zuzino.mipt.ru>
On Thu, 8 May 2008 02:14:50 +0400
Alexey Dobriyan <adobriyan@gmail.com> wrote:
> cpumask_scnprintf_len() takes "len" as an argument which is surprising,
> If one follows call chain down it isn't length but number of bits. But
> there is natural number of bits when talking about CPU masks -- NR_CPUS.
> So use that.
hm, maybe we should delete this function after all ;)
> Remove 1:1 wrapper macro while I'm at it.
There was a reason most of those 1:1 wrappers but yes, this one seems to be
rather cargo-cultish.
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
>
> include/linux/cpumask.h | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> --- a/include/linux/cpumask.h
> +++ b/include/linux/cpumask.h
> @@ -289,11 +289,9 @@ static inline int __cpumask_scnprintf(char *buf, int len,
> return bitmap_scnprintf(buf, len, srcp->bits, nbits);
> }
>
> -#define cpumask_scnprintf_len(len) \
> - __cpumask_scnprintf_len((len))
> -static inline int __cpumask_scnprintf_len(int len)
> +static inline int cpumask_scnprintf_len(void)
> {
> - return bitmap_scnprintf_len(len);
> + return bitmap_scnprintf_len(NR_CPUS);
> }
>
> #define cpumask_parse_user(ubuf, ulen, dst) \
Does Paul have an opinion?
(Well, Paul always has an opinion. But what is it?)
next prev parent reply other threads:[~2008-05-07 21:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-07 22:14 [PATCH 1/5] Fix cpumask_scnprintf_len() misdesign Alexey Dobriyan
2008-05-07 21:35 ` Andrew Morton [this message]
2008-05-07 23:06 ` Paul Jackson
2008-05-08 15:01 ` Bert Wesarg
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=20080507143537.94d744c5.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=adobriyan@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pj@sgi.com \
/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