lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 7 May 2008 14:35:37 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Alexey Dobriyan <adobriyan@...il.com>
Cc:	linux-kernel@...r.kernel.org, Paul Jackson <pj@....com>
Subject: Re: [PATCH 1/5] Fix cpumask_scnprintf_len() misdesign

On Thu, 8 May 2008 02:14:50 +0400
Alexey Dobriyan <adobriyan@...il.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@...il.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?)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ