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:	Mon, 27 Sep 2010 08:10:57 +0100
From:	"Jan Beulich" <JBeulich@...ell.com>
To:	"Chen Gong" <gong.chen@...ux.intel.com>,
	<lm-sensors@...sensors.org>
Cc:	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] hwmon: uniform the init style of pkgtemp

>>> On 26.09.10 at 07:59, Chen Gong <gong.chen@...ux.intel.com> wrote:
> pkgtemp is derived from coretemp, so some reasonable
> logics should be applied onto pkgtemp, too. Such as
> the init logic here.
> 
> Signed-off-by: Chen Gong <gong.chen@...ux.intel.com>

Acked-by: Jan Beulich <jbeulich@...ell.com>

> ---
>  drivers/hwmon/pkgtemp.c |   23 +++++++----------------
>  1 files changed, 7 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/hwmon/pkgtemp.c b/drivers/hwmon/pkgtemp.c
> index f119039..6186041 100644
> --- a/drivers/hwmon/pkgtemp.c
> +++ b/drivers/hwmon/pkgtemp.c
> @@ -392,7 +392,6 @@ static struct notifier_block pkgtemp_cpu_notifier 
> __refdata = {
>  static int __init pkgtemp_init(void)
>  {
>  	int i, err = -ENODEV;
> -	struct pdev_entry *p, *n;
>  
>  	/* quick check if we run Intel */
>  	if (cpu_data(0).x86_vendor != X86_VENDOR_INTEL)
> @@ -402,31 +401,23 @@ static int __init pkgtemp_init(void)
>  	if (err)
>  		goto exit;
>  
> -	for_each_online_cpu(i) {
> -		err = pkgtemp_device_add(i);
> -		if (err)
> -			goto exit_devices_unreg;
> -	}
> +	for_each_online_cpu(i)
> +		pkgtemp_device_add(i);
> +
> +#ifndef CONFIG_HOTPLUG_CPU
>  	if (list_empty(&pdev_list)) {
>  		err = -ENODEV;
>  		goto exit_driver_unreg;
>  	}
> +#endif
>  
> -#ifdef CONFIG_HOTPLUG_CPU
>  	register_hotcpu_notifier(&pkgtemp_cpu_notifier);
> -#endif
>  	return 0;
>  
> -exit_devices_unreg:
> -	mutex_lock(&pdev_list_mutex);
> -	list_for_each_entry_safe(p, n, &pdev_list, list) {
> -		platform_device_unregister(p->pdev);
> -		list_del(&p->list);
> -		kfree(p);
> -	}
> -	mutex_unlock(&pdev_list_mutex);
> +#ifndef CONFIG_HOTPLUG_CPU
>  exit_driver_unreg:
>  	platform_driver_unregister(&pkgtemp_driver);
> +#endif
>  exit:
>  	return err;
>  }




--
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