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:	Tue, 5 Jan 2010 10:53:55 -0800 (PST)
From:	David Rientjes <rientjes@...gle.com>
To:	H Hartley Sweeten <hartleys@...ionengravers.com>
cc:	Linux Kernel <linux-kernel@...r.kernel.org>,
	akpm@...ux-foundation.org, bfields@...ldses.org
Subject: Re: [PATCH] nodemask.h: change any_online_node() to a static
 inline

On Tue, 5 Jan 2010, H Hartley Sweeten wrote:

> diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
> index 454997c..1f66e02 100644
> --- a/include/linux/nodemask.h
> +++ b/include/linux/nodemask.h
> @@ -467,15 +467,6 @@ static inline int num_node_state(enum node_states state)
>  #define node_online_map 	node_states[N_ONLINE]
>  #define node_possible_map 	node_states[N_POSSIBLE]
>  
> -#define any_online_node(mask)			\
> -({						\
> -	int node;				\
> -	for_each_node_mask(node, (mask))	\
> -		if (node_online(node))		\
> -			break;			\
> -	node;					\
> -})
> -
>  #define num_online_nodes()	num_node_state(N_ONLINE)
>  #define num_possible_nodes()	num_node_state(N_POSSIBLE)
>  #define node_online(node)	node_state((node), N_ONLINE)
> @@ -484,6 +475,17 @@ static inline int num_node_state(enum node_states state)
>  #define for_each_node(node)	   for_each_node_state(node, N_POSSIBLE)
>  #define for_each_online_node(node) for_each_node_state(node, N_ONLINE)
>  
> +static inline int any_online_node(nodemask_t mask)
> +{
> +	int node;
> +
> +	for_each_node_mask(node, mask) {
> +		if (node_online(node))
> +			break;
> +	}
> +	return node;
> +}
> +
>  /*
>   * For nodemask scrach area.
>   * NODEMASK_ALLOC(type, name) allocates an object with a specified type and

Could you simply remove any_online_node() and replace its callers with 
first_node(node_online_map) instead?
--
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