From: Bart Van Assche <bvanassche@acm.org>
To: James Bottomley <James.Bottomley@HansenPartnership.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Brian Bunker <brian@purestorage.com>,
Damien Le Moal <dlemoal@kernel.org>,
Hannes Reinecke <hare@suse.de>,
Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH 2/2] scsi: core: Convert inquiry information
Date: Wed, 13 May 2026 10:49:40 -0700 [thread overview]
Message-ID: <8b3090fc-0342-4c29-9345-da29ed651fab@acm.org> (raw)
In-Reply-To: <b9b20ed6506ccd0d525abbd9da1f54c65ba76a8f.camel@HansenPartnership.com>
On 5/13/26 5:49 AM, James Bottomley wrote:
> On Tue, 2026-05-12 at 12:46 -0700, Bart Van Assche wrote:
>> @@ -905,9 +905,9 @@ static int scsi_add_lun(struct scsi_device *sdev,
>> unsigned char *inq_result,
>> if (sdev->inquiry == NULL)
>> return SCSI_SCAN_NO_RESPONSE;
>>
>> - sdev->vendor = (char *) (sdev->inquiry + 8);
>> - sdev->model = (char *) (sdev->inquiry + 16);
>> - sdev->rev = (char *) (sdev->inquiry + 32);
>> + strscpy(sdev->vendor, sdev->inquiry + 8);
>> + strscpy(sdev->model, sdev->inquiry + 16);
>> + strscpy(sdev->rev, sdev->inquiry + 32);
>>
>> sdev->is_ata = strncmp(sdev->vendor, "ATA ", 8) == 0;
>> if (sdev->is_ata) {
>
> If you've gone to all the trouble to lift the lengths out as #defines,
> shouldn't we do the same with the offsets?
Hi James,
I will introduce symbolic names for the offsets in the next version of
this patch series.
Thanks,
Bart.
prev parent reply other threads:[~2026-05-13 17:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 19:46 [PATCH 0/2] Rework the struct scsi_device inquiry information Bart Van Assche
2026-05-12 19:46 ` [PATCH 1/2] scsi: core, target: Move three constants into <scsi/scsi_common.h> Bart Van Assche
2026-05-13 8:04 ` Damien Le Moal
2026-05-13 9:28 ` Hannes Reinecke
2026-05-12 19:46 ` [PATCH 2/2] scsi: core: Convert inquiry information Bart Van Assche
2026-05-13 8:03 ` Damien Le Moal
2026-05-13 17:26 ` Bart Van Assche
2026-05-13 18:40 ` Guenter Roeck
2026-05-13 9:33 ` Hannes Reinecke
2026-05-13 17:40 ` Bart Van Assche
2026-05-13 12:49 ` James Bottomley
2026-05-13 17:49 ` Bart Van Assche [this message]
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=8b3090fc-0342-4c29-9345-da29ed651fab@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=brian@purestorage.com \
--cc=dlemoal@kernel.org \
--cc=hare@suse.de \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=martin.petersen@oracle.com \
/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