mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: snic: Remove unused linkstatus
@ 2026-02-16 14:10 Thomas Fourier
  2026-02-17 20:40 ` Karan Tilak Kumar (kartilak)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Fourier @ 2026-02-16 14:10 UTC (permalink / raw)
  Cc: Thomas Fourier, Karan Tilak Kumar, Sesidhar Baddela,
	James E.J. Bottomley, Martin K. Petersen, linux-scsi,
	linux-kernel

The (struct vnic_dev).linkstatus buffer is freed in
svnic_dev_unregister() and referenced in svnic_dev_link_status() but
never alloc'd. This means (struct vnic_dev).linkstatus is always null
and the dealloc the reference in svnic_dev_link_status() is dead code.

Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
---
 drivers/scsi/snic/vnic_dev.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/scsi/snic/vnic_dev.c b/drivers/scsi/snic/vnic_dev.c
index 760f3f22095c..c4df0b17c86c 100644
--- a/drivers/scsi/snic/vnic_dev.c
+++ b/drivers/scsi/snic/vnic_dev.c
@@ -42,8 +42,6 @@ struct vnic_dev {
 	struct vnic_devcmd_notify *notify;
 	struct vnic_devcmd_notify notify_copy;
 	dma_addr_t notify_pa;
-	u32 *linkstatus;
-	dma_addr_t linkstatus_pa;
 	struct vnic_stats *stats;
 	dma_addr_t stats_pa;
 	struct vnic_devcmd_fw_info *fw_info;
@@ -650,8 +648,6 @@ int svnic_dev_init(struct vnic_dev *vdev, int arg)
 
 int svnic_dev_link_status(struct vnic_dev *vdev)
 {
-	if (vdev->linkstatus)
-		return *vdev->linkstatus;
 
 	if (!vnic_dev_notify_ready(vdev))
 		return 0;
@@ -686,11 +682,6 @@ void svnic_dev_unregister(struct vnic_dev *vdev)
 				sizeof(struct vnic_devcmd_notify),
 				vdev->notify,
 				vdev->notify_pa);
-		if (vdev->linkstatus)
-			dma_free_coherent(&vdev->pdev->dev,
-				sizeof(u32),
-				vdev->linkstatus,
-				vdev->linkstatus_pa);
 		if (vdev->stats)
 			dma_free_coherent(&vdev->pdev->dev,
 				sizeof(struct vnic_stats),
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-02-24 16:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-16 14:10 [PATCH] scsi: snic: Remove unused linkstatus Thomas Fourier
2026-02-17 20:40 ` Karan Tilak Kumar (kartilak)
2026-02-18  2:37 ` Martin K. Petersen
2026-02-24 16:47 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®