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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 28 Jan 2015 13:06:23 -0800
From:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:	Takashi Iwai <tiwai@...e.de>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] drivers/base/node: Use device_create_files() and
 device_remove_files()

On Wed, Jan 28, 2015 at 09:46:14PM +0100, Takashi Iwai wrote:
> Use the new helper functions to simplify the code.
> 
> Signed-off-by: Takashi Iwai <tiwai@...e.de>
> ---
>  drivers/base/node.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/base/node.c b/drivers/base/node.c
> index a3b82e9c7f20..e567e7bde333 100644
> --- a/drivers/base/node.c
> +++ b/drivers/base/node.c
> @@ -200,6 +200,16 @@ static ssize_t node_read_distance(struct device *dev,
>  }
>  static DEVICE_ATTR(distance, S_IRUGO, node_read_distance, NULL);
>  
> +static const struct device_attribute *node_dev_attrs[] = {
> +	&dev_attr_cpumap,
> +	&dev_attr_cpulist,
> +	&dev_attr_meminfo,
> +	&dev_attr_numastat,
> +	&dev_attr_distance,
> +	&dev_attr_vmstat,
> +	NULL
> +};
> +
>  #ifdef CONFIG_HUGETLBFS
>  /*
>   * hugetlbfs per node attributes registration interface:
> @@ -276,12 +286,7 @@ static int register_node(struct node *node, int num, struct node *parent)
>  	error = device_register(&node->dev);
>  
>  	if (!error){
> -		device_create_file(&node->dev, &dev_attr_cpumap);
> -		device_create_file(&node->dev, &dev_attr_cpulist);
> -		device_create_file(&node->dev, &dev_attr_meminfo);
> -		device_create_file(&node->dev, &dev_attr_numastat);
> -		device_create_file(&node->dev, &dev_attr_distance);
> -		device_create_file(&node->dev, &dev_attr_vmstat);
> +		device_create_files(&node->dev, node_dev_attrs);

This should just be using an attribute group instead of these files all
being created at once, care to switch the code to use that instead?

thanks,

greg k-h
--
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