diff options
| author | Ian Bridges <icb@fastmail.org> | 2026-07-29 09:46:16 -0500 |
|---|---|---|
| committer | Martin K. Petersen (Oracle) <mkp@kernel.org> | 2026-08-13 22:15:22 -0400 |
| commit | 4832a60e0a7818400afffa392b74776d084ddf4a (patch) | |
| tree | 7128a0bbf43ed2c2f760ea45c376c28d4c9d654f /scripts/objdiff | |
| parent | 22d4cbf6f7509f0aab58d60d488a0082916a2fb0 (diff) | |
| download | linux-next-4832a60e0a7818400afffa392b74776d084ddf4a.tar.gz linux-next-4832a60e0a7818400afffa392b74776d084ddf4a.zip | |
scsi: lpfc: Replace strlcat() with seq_buf in the debugfs dump helpers
In preparation for removing the strlcat() API[1], replace its uses in
lpfc_debugfs_multixripools_data(), lpfc_debugfs_scsistat_data() and
lpfc_debugfs_hdwqstat_data().
Each helper accumulates a variable number of lines into the debugfs
buffer, which is what seq_buf is for. The intermediate tmp buffers and
the per fragment overflow checks become unnecessary. Once a seq_buf
overflows, later writes to it do nothing, so dropping the early exits
does not change the produced bytes. Each loop that appends keeps one
seq_buf_has_overflowed() exit, so a full buffer stops the iteration.
lpfc_debugfs_multixripools_data() and lpfc_debugfs_hdwqstat_data()
append to whatever the buffer already holds, so their seq_buf is
anchored at the current end of the string. All three helpers keep
returning strnlen() because seq_buf_used() reports the full buffer size
after an overflow.
Link: https://github.com/KSPP/linux/issues/370 [1]
Signed-off-by: Ian Bridges <icb@fastmail.org>
Link: https://patch.msgid.link/20260729144617.1388646-5-icb@fastmail.org
Reviewed-by: Nigel Kirkland <nigel.kirkland@broadcom.com>
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'scripts/objdiff')
0 files changed, 0 insertions, 0 deletions
