Skip to contentSkip to conversation

watchdog: wdt285: Fix variable type

PATCH In review Alexander Shiyan 3 participants 3 messages Feb 15, 2014 – Feb 24, 2014 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: wdt285: Fix variable type

Variable "new_margin" is checked in the function watchdog_ioctl() to be positive, so change its type to "int".

---
 drivers/watchdog/wdt285.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/watchdog/wdt285.c +1 -2
index 7355ddd0..ebbb183 100644
@@ -139,9 +139,8 @@ static const struct watchdog_info ident = {
 static long watchdog_ioctl(struct file *file, unsigned int cmd,
 			   unsigned long arg)
 {
-	unsigned int new_margin;
 	int __user *int_arg = (int __user *)arg;
-	int ret = -ENOTTY;
+	int new_margin, ret = -ENOTTY;
 
 	switch (cmd) {
 	case WDIOC_GETSUPPORT:
Signature · 1 line
1.8.3.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Alexander Shiyan

Variable "new_margin" is checked in the function watchdog_ioctl() to be positive, so change its type to "int".

non-negative, really.

Other than that,

Quoted 29 lines
---
 drivers/watchdog/wdt285.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/watchdog/wdt285.c +1 -2
index 7355ddd0..ebbb183 100644
@@ -139,9 +139,8 @@ static const struct watchdog_info ident = {
 static long watchdog_ioctl(struct file *file, unsigned int cmd,
 			   unsigned long arg)
 {
-	unsigned int new_margin;
 	int __user *int_arg = (int __user *)arg;
-	int ret = -ENOTTY;
+	int new_margin, ret = -ENOTTY;
 
 	switch (cmd) {
 	case WDIOC_GETSUPPORT:
Signature · 6 lines
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to Alexander Shiyan

Hi Alexander,

Quoted 26 lines

Variable "new_margin" is checked in the function watchdog_ioctl() to be positive, so change its type to "int".

---
 drivers/watchdog/wdt285.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/watchdog/wdt285.c +1 -2
index 7355ddd0..ebbb183 100644
@@ -139,9 +139,8 @@ static const struct watchdog_info ident = {
 static long watchdog_ioctl(struct file *file, unsigned int cmd,
 			   unsigned long arg)
 {
-	unsigned int new_margin;
 	int __user *int_arg = (int __user *)arg;
-	int ret = -ENOTTY;
+	int new_margin, ret = -ENOTTY;
 
 	switch (cmd) {
 	case WDIOC_GETSUPPORT:
Signature · 1 line
1.8.3.2

This patch has been added to linux-watchdog-next.

Kind regards,
Wim.