Re: [PATCH] scsi: core: Consult supported VPD page list prior to fetching page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/14/24 10:25, Martin K. Petersen wrote:
+		for (unsigned int i = SCSI_VPD_HEADER_SIZE ; i < result ; i++) {
+			if (vpd[i] == page)
+				goto found;
+		}

Can this loop be changed into a memchr() call?

diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index cb019c80763b..6673885565e3 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -102,6 +102,7 @@ struct scsi_vpd {
enum scsi_vpd_parameters {
  	SCSI_VPD_HEADER_SIZE = 4,
+	SCSI_VPD_LIST_SIZE = 36,
  };
struct scsi_device {

Since these constants are only used inside drivers/scsi/scsi.c, how about
moving these constants into the drivers/scsi/scsi.c file?

Thanks,

Bart.




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux