Skip to contentSkip to conversation

platform / x86: Fix incorrect sscanf() string datatype.

PATCH New Luis G.F 1 participant 1 message Feb 10, 2014 x86 platform drivers

lore
Share & tools
lore

Luis G.F

author
#0 lore raw

PATCH 1/2 platform / x86: Fix incorrect sscanf() string datatype.

Fix incorrect sscanf() string datatype in following functions:

- cmos_write()
- beep_write()
- volume_writter().

Change from 'unsigned int *' to 'int *'

---
 drivers/platform/x86/thinkpad_acpi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +3 -3
index defb6af..1646300 100644
@@ -4962,7 +4962,7 @@ static int cmos_write(char *buf)
 	int cmos_cmd, res;
 
 	while ((cmd = next_cmd(&buf))) {
-		if (sscanf(cmd, "%u", &cmos_cmd) == 1 &&
+		if (sscanf(cmd, "%d", &cmos_cmd) == 1 &&
 		    cmos_cmd >= 0 && cmos_cmd <= 21) {
 			/* cmos_cmd set */
 		} else
@@ -5467,7 +5467,7 @@ static int beep_write(char *buf)
 		return -ENODEV;
 
 	while ((cmd = next_cmd(&buf))) {
-		if (sscanf(cmd, "%u", &beep_cmd) == 1 &&
+		if (sscanf(cmd, "%d", &beep_cmd) == 1 &&
 		    beep_cmd >= 0 && beep_cmd <= 17) {
 			/* beep_cmd set */
 		} else
@@ -7047,7 +7047,7 @@ static int volume_write(char *buf)
 				else if (new_level > 0)
 					new_level--;
 				continue;
-			} else if (sscanf(cmd, "level %u", &l) == 1 &&
+			} else if (sscanf(cmd, "level %d", &l) == 1 &&
 				   l >= 0 && l <= TP_EC_VOLUME_MAX) {
 					new_level = l;
 				continue;
Signature · 1 line
1.8.4.5