diff options
| author | Michael Straube <[email protected]> | 2022-07-30 17:06:37 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2022-08-16 15:14:19 +0200 |
| commit | ef21bdc5b671f85607c39000320cbcfabed83867 (patch) | |
| tree | 31bc1bc69a8e190e5e22f294c9aa9c0ea8a1e915 /tools/perf/scripts | |
| parent | c026b483f8f2eff1478f7edd55a2aef4cf9ebc2e (diff) | |
staging: r8188eu: refactor dump_chip_info()
Refactor the function dump_chip_info() to make the code cleaner and
reduce the driver object file size. Instead of using sprintf() to
print all the information to a buffer use a char pointer for the cut
version string and print the other strings directly by netdev_dbg().
For the unknown cut string we can use a smaller buffer and print to
that buffer with snprintf() to be safe.
These changes avoid the possible buffer overflow that the original
code had and reduces the driver object file size by 1029 bytes.
Suggested-by: Joe Perches <[email protected]>
Tested-by: Philipp Hortmann <[email protected]> # Edimax N150
Signed-off-by: Michael Straube <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts')
0 files changed, 0 insertions, 0 deletions