All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH] hwmon: (fschmd) Drop useless mutex
@ 2010-11-29 12:16 Jean Delvare
  2010-11-29 14:53 ` Guenter Roeck
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jean Delvare @ 2010-11-29 12:16 UTC (permalink / raw)
  To: lm-sensors

As discussed one year ago, the WDIOC_GETSUPPORT ioctl only needs a
mutex because it operates on a static variable. There is no good
reason to keep this variable static, so let's just make it non-static
and drop the now useless mutex altogether.

See the discussion at:
http://marc.info/?l=lm-sensors&m\x125563869402323&w=2

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Hans de Goede <hdegoede@redhat.com>
---
 drivers/hwmon/fschmd.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- linux-2.6.37-rc3.orig/drivers/hwmon/fschmd.c	2010-11-02 09:19:35.000000000 +0100
+++ linux-2.6.37-rc3/drivers/hwmon/fschmd.c	2010-11-29 13:02:16.000000000 +0100
@@ -49,7 +49,6 @@
 #include <linux/kref.h>
 
 /* Addresses to scan */
-static DEFINE_MUTEX(watchdog_mutex);
 static const unsigned short normal_i2c[] = { 0x73, I2C_CLIENT_END };
 
 /* Insmod parameters */
@@ -850,7 +849,7 @@ static ssize_t watchdog_write(struct fil
 
 static long watchdog_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 {
-	static struct watchdog_info ident = {
+	struct watchdog_info ident = {
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT |
 				WDIOF_CARDRESET,
 		.identity = "FSC watchdog"
@@ -858,7 +857,6 @@ static long watchdog_ioctl(struct file *
 	int i, ret = 0;
 	struct fschmd_data *data = filp->private_data;
 
-	mutex_lock(&watchdog_mutex);
 	switch (cmd) {
 	case WDIOC_GETSUPPORT:
 		ident.firmware_version = data->revision;
@@ -915,7 +913,6 @@ static long watchdog_ioctl(struct file *
 	default:
 		ret = -ENOTTY;
 	}
-	mutex_unlock(&watchdog_mutex);
 	return ret;
 }
 


-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-29 16:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-29 12:16 [lm-sensors] [PATCH] hwmon: (fschmd) Drop useless mutex Jean Delvare
2010-11-29 14:53 ` Guenter Roeck
2010-11-29 16:54 ` Arnd Bergmann
2010-11-29 16:57 ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.