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] [day] [month] [year] [list]
Date:	Tue, 31 Mar 2015 13:55:10 +1030
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Rasmus Villemoes <linux@...musvillemoes.dk>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Tejun Heo <tj@...nel.org>,
	Rasmus Villemoes <linux@...musvillemoes.dk>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] linux/cpumask.h: add typechecking to cpumask_test_cpu

Rasmus Villemoes <linux@...musvillemoes.dk> writes:
> The Subtlety (1) referred to vanished with 6ba2ef7baac2 ("cpumask:
> Move deprecated functions to end of header."). That used to mention
> some suboptimal code generation by a, by now, rather ancient gcc. With
> gcc 4.7, I don't see any change in the generated code by making it a
> static inline, so let's add type checking and get rid of the ghost
> reference.
>
> Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>

Thanks, applied.

Cheers,
Rusty.

> ---
>  include/linux/cpumask.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
> index 086549a665e2..972c30e0714e 100644
> --- a/include/linux/cpumask.h
> +++ b/include/linux/cpumask.h
> @@ -289,11 +289,11 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
>   * @cpumask: the cpumask pointer
>   *
>   * Returns 1 if @cpu is set in @cpumask, else returns 0
> - *
> - * No static inline type checking - see Subtlety (1) above.
>   */
> -#define cpumask_test_cpu(cpu, cpumask) \
> -	test_bit(cpumask_check(cpu), cpumask_bits((cpumask)))
> +static inline int cpumask_test_cpu(int cpu, const struct cpumask *cpumask)
> +{
> +	return test_bit(cpumask_check(cpu), cpumask_bits((cpumask)));
> +}
>  
>  /**
>   * cpumask_test_and_set_cpu - atomically test and set a cpu in a cpumask
> -- 
> 2.1.3
--
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