Skip to contentSkip to conversation

hwmon: (fschmd) Drop useless mutex

PATCH In review Jean Delvare 4 participants 4 messages Nov 29, 2010 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (fschmd) Drop useless mutex

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&m5563869402323&w=2

Cc Thomas Gleixner <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Hans de Goede <[email protected]>
---
 drivers/hwmon/fschmd.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/hwmon/fschmd.c +1 -4
@@ -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;
 }
 
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jean Delvare

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.

Quoted 7 lines

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

Cc Thomas Gleixner <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Hans de Goede <[email protected]>

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

Acked-by on v1 1/1
#2 lore raw
In reply to Jean Delvare
Quoted 5 lines · Jean Delvare

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.

Quoted 7 lines

See the discussion at:
http://marc.info/?l=lm-sensors&amp;m5563869402323&amp;w=2

Cc Thomas Gleixner <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Hans de Goede <[email protected]>

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

Acked-by on v1 1/1
#3 lore raw
In reply to Jean Delvare
Quoted 9 lines · Arnd Bergmann
Quoted 8 lines · Jean Delvare

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&amp;m5563869402323&amp;w=2

Quoted 6 lines
Quoted 4 lines
Cc Thomas Gleixner <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Hans de Goede <[email protected]>

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors