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, 8 Sep 2010 15:39:32 +0200
From:	Jean Delvare <khali@...ux-fr.org>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <peterz@...radead.org>,
	Christoph Hellwig <hch@...radead.org>,
	Ben Dooks <ben-linux@...ff.org>, lm-sensors@...sensors.org
Subject: Re: [patch 29/30] hwmon: s3c-hwmon: Use a real mutex

On Tue, 07 Sep 2010 14:33:57 -0000, Thomas Gleixner wrote:
> The semaphore which protects the ADC is semantically a mutex. Use a
> real mutex.
> 
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Cc: Jean Delvare <khali@...ux-fr.org>
> Cc: Ben Dooks <ben-linux@...ff.org>
> Cc: lm-sensors@...sensors.org
> ---
>  drivers/hwmon/s3c-hwmon.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> Index: linux-2.6/drivers/hwmon/s3c-hwmon.c
> ===================================================================
> --- linux-2.6.orig/drivers/hwmon/s3c-hwmon.c
> +++ linux-2.6/drivers/hwmon/s3c-hwmon.c
> @@ -51,7 +51,7 @@ struct s3c_hwmon_attr {
>   * @attr: The holders for the channel attributes.
>  */
>  struct s3c_hwmon {
> -	struct semaphore	lock;
> +	struct mutex		lock;
>  	struct s3c_adc_client	*client;
>  	struct device		*hwmon_dev;
>  
> @@ -73,14 +73,14 @@ static int s3c_hwmon_read_ch(struct devi
>  {
>  	int ret;
>  
> -	ret = down_interruptible(&hwmon->lock);
> +	ret = mutex_lock_interruptible(&hwmon->lock);
>  	if (ret < 0)
>  		return ret;
>  
>  	dev_dbg(dev, "reading channel %d\n", channel);
>  
>  	ret = s3c_adc_read(hwmon->client, channel);
> -	up(&hwmon->lock);
> +	mutex_unlock(&hwmon->lock);
>  
>  	return ret;
>  }
> @@ -296,7 +296,7 @@ static int __devinit s3c_hwmon_probe(str
>  
>  	platform_set_drvdata(dev, hwmon);
>  
> -	init_MUTEX(&hwmon->lock);
> +	mutex_init(&hwmon->lock);
>  
>  	/* Register with the core ADC driver. */
>  
> 
> 

Applied, thanks.

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