Linux USB
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org
Cc: belegdol@gmail.com, stable@vger.kernel.org
Subject: Re: [PATCH] scsi: core: Consult supported VPD page list prior to fetching page
Date: Wed, 14 Feb 2024 10:44:35 -0800	[thread overview]
Message-ID: <a0f6d397-8162-4e89-a1ff-99540c70fa00@acm.org> (raw)
In-Reply-To: <20240214182535.2533977-1-martin.petersen@oracle.com>

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.

  reply	other threads:[~2024-02-14 18:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14 18:25 [PATCH] scsi: core: Consult supported VPD page list prior to fetching page Martin K. Petersen
2024-02-14 18:44 ` Bart Van Assche [this message]
2024-02-14 20:20   ` Martin K. Petersen
2024-02-14 21:41     ` Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a0f6d397-8162-4e89-a1ff-99540c70fa00@acm.org \
    --to=bvanassche@acm.org \
    --cc=belegdol@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox