Commit 37a76c6
i40e: Replace sscanf() with kstrtoint() in i40e_dbg_netdev_ops_write()
Commit 9fcdb1c ("i40e: remove read access to debugfs files")
introduced some checkpatch warnings like this:
WARNING: Prefer kstrto<type> to single variable sscanf
kernel-patches#240: FILE: drivers/net/ethernet/intel/i40e/i40e_debugfs.c:1655:
+ cnt = sscanf(&cmd_buf[11], "%i", &vsi_seid);
WARNING: Prefer kstrto<type> to single variable sscanf
kernel-patches#251: FILE: drivers/net/ethernet/intel/i40e/i40e_debugfs.c:1676:
+ cnt = sscanf(&cmd_buf[4], "%i", &vsi_seid);
total: 0 errors, 2 warnings, 0 checks, 194 lines checked
Function kstrtoint() provides better error detection, overflow protection,
and consistent error handling than sscanf(). Replace sscanf() with
kstrtoint() in i40e_dbg_netdev_ops_write() to silence the checkpatch
warnings.
Signed-off-by: Wang Liang <wangliang74@huawei.com>
Signed-off-by: NipaLocal <nipa@local>1 parent 8b00b10 commit 37a76c6
1 file changed
+7
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1604 | 1604 | | |
1605 | 1605 | | |
1606 | 1606 | | |
1607 | | - | |
| 1607 | + | |
1608 | 1608 | | |
1609 | 1609 | | |
1610 | 1610 | | |
| |||
1629 | 1629 | | |
1630 | 1630 | | |
1631 | 1631 | | |
1632 | | - | |
| 1632 | + | |
1633 | 1633 | | |
1634 | | - | |
| 1634 | + | |
1635 | 1635 | | |
1636 | 1636 | | |
1637 | 1637 | | |
| |||
1652 | 1652 | | |
1653 | 1653 | | |
1654 | 1654 | | |
1655 | | - | |
1656 | | - | |
| 1655 | + | |
| 1656 | + | |
1657 | 1657 | | |
1658 | 1658 | | |
1659 | 1659 | | |
| |||
1673 | 1673 | | |
1674 | 1674 | | |
1675 | 1675 | | |
1676 | | - | |
1677 | | - | |
| 1676 | + | |
| 1677 | + | |
1678 | 1678 | | |
1679 | 1679 | | |
1680 | 1680 | | |
| |||
0 commit comments