i40e: fix up scanf decoders
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>
This commit is contained in:
parent
7792fe4fd2
commit
2706a20e0b
@ -1466,7 +1466,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
|
|||||||
} else if (strncmp(cmd_buf, "read", 4) == 0) {
|
} else if (strncmp(cmd_buf, "read", 4) == 0) {
|
||||||
u32 address;
|
u32 address;
|
||||||
u32 value;
|
u32 value;
|
||||||
cnt = sscanf(&cmd_buf[4], "%x", &address);
|
cnt = sscanf(&cmd_buf[4], "%i", &address);
|
||||||
if (cnt != 1) {
|
if (cnt != 1) {
|
||||||
dev_info(&pf->pdev->dev, "read <reg>\n");
|
dev_info(&pf->pdev->dev, "read <reg>\n");
|
||||||
goto command_write_done;
|
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) {
|
} else if (strncmp(cmd_buf, "write", 5) == 0) {
|
||||||
u32 address, value;
|
u32 address, value;
|
||||||
cnt = sscanf(&cmd_buf[5], "%x %x", &address, &value);
|
cnt = sscanf(&cmd_buf[5], "%i %i", &address, &value);
|
||||||
if (cnt != 2) {
|
if (cnt != 2) {
|
||||||
dev_info(&pf->pdev->dev, "write <reg> <value>\n");
|
dev_info(&pf->pdev->dev, "write <reg> <value>\n");
|
||||||
goto command_write_done;
|
goto command_write_done;
|
||||||
@ -1503,7 +1503,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
|
|||||||
address, value);
|
address, value);
|
||||||
} else if (strncmp(cmd_buf, "clear_stats", 11) == 0) {
|
} else if (strncmp(cmd_buf, "clear_stats", 11) == 0) {
|
||||||
if (strncmp(&cmd_buf[12], "vsi", 3) == 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) {
|
if (cnt == 0) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < pf->hw.func_caps.num_vsis; i++)
|
for (i = 0; i < pf->hw.func_caps.num_vsis; i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user