summaryrefslogtreecommitdiff
path: root/drivers/scsi/lpfc/lpfc_scsi.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-08-29 11:55:36 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-08-29 11:55:36 -0700
commit08dbfad3f5040f5bdb6c529da20d6d4e81fefd72 (patch)
tree94767b4d009979fd40f7c1deab59bb578c88529b /drivers/scsi/lpfc/lpfc_scsi.c
parentcf72cbb39da84b6f02f90c07f33b102fc10b16f0 (diff)
parent12e67eb89eb2b9516685c744d3f7de0a2d1bd701 (diff)
downloadlinux-stable-master.tar.gz
linux-stable-master.zip
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsiHEADmaster
Pull more SCSI updates from Martin Petersen: "Remaining updates for the 7.3 merge window. The only core change is enabling context analysis for the SCSI layer and UFS. The remaining changes are either bug fixes or hardening" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi: (26 commits) scsi: snic: Fix SCSI host leak on workqueue allocation failure scsi: MAINTAINERS: Update my email address scsi: MAINTAINERS: Leave the cumana_1 and oak drivers to the RISCPC maintainers scsi: leapraid: Standardize NCQ priority sysfs attributes scsi: leapraid: Serialize firmware log mmap with teardown scsi: leapraid: Balance host references for firmware log VMAs scsi: lpfc: Remove unnnecessary NULL check scsi: qla2xxx: Fix an loop timeout test scsi: qla2xxx: Fix an error code in qla_get_tmf() scsi: ibmvfc: Fix use of uninitialized rport in ibmvfc_do_work() scsi: core: Enable context analysis for hosts.o scsi: lpfc: Replace strlcat() with sysfs_emit_at() in the sysfs show functions scsi: lpfc: Replace strlcat() with seq_buf in the debugfs dump helpers scsi: lpfc: Replace strlcat() with seq_buf in lpfc_rx_monitor_report() scsi: lpfc: Replace strlcat() with scnprintf() in lpfc_vport_symbolic_node_name() scsi: lpfc: Replace strlcat() with seq_buf in lpfc_info() scsi: core: Enable context analysis scsi: core: Protect host state changes with the host lock scsi: core: Add lock context annotations scsi: core: Pass the SCSI host pointer directly to scanning functions ...
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_scsi.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c49
1 files changed, 15 insertions, 34 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index f2cab134af7f..8a795c65e3c3 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -21,6 +21,7 @@
* included with this package. *
*******************************************************************/
#include <linux/pci.h>
+#include <linux/seq_buf.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/export.h>
@@ -5103,57 +5104,37 @@ lpfc_info(struct Scsi_Host *host)
struct lpfc_hba *phba = vport->phba;
int link_speed = 0;
static char lpfcinfobuf[384];
- char tmp[384] = {0};
+ struct seq_buf s;
memset(lpfcinfobuf, 0, sizeof(lpfcinfobuf));
+ seq_buf_init(&s, lpfcinfobuf, sizeof(lpfcinfobuf));
if (phba && phba->pcidev){
/* Model Description */
- scnprintf(tmp, sizeof(tmp), phba->ModelDesc);
- if (strlcat(lpfcinfobuf, tmp, sizeof(lpfcinfobuf)) >=
- sizeof(lpfcinfobuf))
- goto buffer_done;
+ seq_buf_printf(&s, "%s", phba->ModelDesc);
/* PCI Info */
- scnprintf(tmp, sizeof(tmp),
- " on PCI bus %02x device %02x irq %d",
- phba->pcidev->bus->number, phba->pcidev->devfn,
- phba->pcidev->irq);
- if (strlcat(lpfcinfobuf, tmp, sizeof(lpfcinfobuf)) >=
- sizeof(lpfcinfobuf))
- goto buffer_done;
+ seq_buf_printf(&s, " on PCI bus %02x device %02x irq %d",
+ phba->pcidev->bus->number, phba->pcidev->devfn,
+ phba->pcidev->irq);
/* Port Number */
- if (phba->Port[0]) {
- scnprintf(tmp, sizeof(tmp), " port %s", phba->Port);
- if (strlcat(lpfcinfobuf, tmp, sizeof(lpfcinfobuf)) >=
- sizeof(lpfcinfobuf))
- goto buffer_done;
- }
+ if (phba->Port[0])
+ seq_buf_printf(&s, " port %s", phba->Port);
/* Link Speed */
link_speed = lpfc_sli_port_speed_get(phba);
- if (link_speed != 0) {
- scnprintf(tmp, sizeof(tmp),
- " Logical Link Speed: %d Mbps", link_speed);
- if (strlcat(lpfcinfobuf, tmp, sizeof(lpfcinfobuf)) >=
- sizeof(lpfcinfobuf))
- goto buffer_done;
- }
+ if (link_speed != 0)
+ seq_buf_printf(&s, " Logical Link Speed: %d Mbps",
+ link_speed);
/* Support for BSG ioctls */
- scnprintf(tmp, sizeof(tmp), " BSG");
- if (strlcat(lpfcinfobuf, tmp, sizeof(lpfcinfobuf)) >=
- sizeof(lpfcinfobuf))
- goto buffer_done;
+ seq_buf_printf(&s, " BSG");
/* PCI resettable */
- if (!lpfc_check_pci_resettable(phba)) {
- scnprintf(tmp, sizeof(tmp), " PCI resettable");
- strlcat(lpfcinfobuf, tmp, sizeof(lpfcinfobuf));
- }
+ if (!lpfc_check_pci_resettable(phba))
+ seq_buf_printf(&s, " PCI resettable");
}
-buffer_done:
return lpfcinfobuf;
}