scsi: core: Use the INQUIRY-related constants

Use symbolic names instead of numeric constants to access the vendor and
model information.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Brian Bunker <brian@purestorage.com>
Link: https://patch.msgid.link/20260515205222.1754621-3-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Bart Van Assche 2026-05-15 13:52:20 -07:00 committed by Martin K. Petersen
parent b1968f4650
commit 28ff38b9d8

View File

@ -728,9 +728,13 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
}
if (result == 0) {
scsi_sanitize_inquiry_string(&inq_result[8], 8);
scsi_sanitize_inquiry_string(&inq_result[16], 16);
scsi_sanitize_inquiry_string(&inq_result[32], 4);
scsi_sanitize_inquiry_string(&inq_result[INQUIRY_VENDOR_OFFSET],
INQUIRY_VENDOR_LEN);
scsi_sanitize_inquiry_string(&inq_result[INQUIRY_MODEL_OFFSET],
INQUIRY_MODEL_LEN);
scsi_sanitize_inquiry_string(
&inq_result[INQUIRY_REVISION_OFFSET],
INQUIRY_REVISION_LEN);
response_len = inq_result[4] + 5;
if (response_len > 255)
@ -743,8 +747,9 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
* corresponding bit fields in scsi_device, so bflags
* need not be passed as an argument.
*/
*bflags = scsi_get_device_flags(sdev, &inq_result[8],
&inq_result[16]);
*bflags = scsi_get_device_flags(sdev,
&inq_result[INQUIRY_VENDOR_OFFSET],
&inq_result[INQUIRY_MODEL_OFFSET]);
/* When the first pass succeeds we gain information about
* what larger transfer lengths might work. */