i40e: fix up scanf decoders
authorShannon Nelson <shannon.nelson@intel.com>
Tue, 26 Nov 2013 10:49:30 +0000 (10:49 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 18 Dec 2013 06:42:30 +0000 (22:42 -0800)
Fix up a couple of scanfs to accept various base numbers instead of silently
requiring hex.

Change-Id: I1cc4dffbb1d011bf603cbf34a8db093da57fad7a
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_debugfs.c

index 0768beb271ed0a57ed72e7a82258fba45db69197..abac8312ef19127e12eecd624e8c769859069534 100644 (file)
@@ -1466,7 +1466,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
        } else if (strncmp(cmd_buf, "read", 4) == 0) {
                u32 address;
                u32 value;
-               cnt = sscanf(&cmd_buf[4], "%x", &address);
+               cnt = sscanf(&cmd_buf[4], "%i", &address);
                if (cnt != 1) {
                        dev_info(&pf->pdev->dev, "read <reg>\n");
                        goto command_write_done;
@@ -1485,7 +1485,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
 
        } else if (strncmp(cmd_buf, "write", 5) == 0) {
                u32 address, value;
-               cnt = sscanf(&cmd_buf[5], "%x %x", &address, &value);
+               cnt = sscanf(&cmd_buf[5], "%i %i", &address, &value);
                if (cnt != 2) {
                        dev_info(&pf->pdev->dev, "write <reg> <value>\n");
                        goto command_write_done;
@@ -1503,7 +1503,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
                         address, value);
        } else if (strncmp(cmd_buf, "clear_stats", 11) == 0) {
                if (strncmp(&cmd_buf[12], "vsi", 3) == 0) {
-                       cnt = sscanf(&cmd_buf[15], "%d", &vsi_seid);
+                       cnt = sscanf(&cmd_buf[15], "%i", &vsi_seid);
                        if (cnt == 0) {
                                int i;
                                for (i = 0; i < pf->hw.func_caps.num_vsis; i++)