[PATCH 2/5] scsi: core: drop the dead VPD size check
From: shao.mingyin
Date: Thu Nov 05 2026 - 06:35:59 EST
From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
scsi_vpd_inquiry() returns result + 4 where result is the page length
and is non-zero (otherwise it returns -EIO), so the returned value is at
least 5 bytes and the "result < SCSI_VPD_HEADER_SIZE" branch can never be
taken.
No functional change.
Signed-off-by: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
---
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 05232ab6366f..fe4d748cab1a 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -378,13 +378,6 @@ static int scsi_get_vpd_size(struct scsi_device *sdev, u8 page)
if (result < 0)
return 0;
- if (result < SCSI_VPD_HEADER_SIZE) {
- dev_warn_once(&sdev->sdev_gendev,
- "%s: short VPD page 0x%02x length: %d bytes\n",
- __func__, page, result);
- return 0;
- }
-
return result;
}