From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Bart Van Assche <bvanassche@acm.org>,
"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 08:49:36 -0400 [thread overview]
Message-ID: <b9b20ed6506ccd0d525abbd9da1f54c65ba76a8f.camel@HansenPartnership.com> (raw)
In-Reply-To: <20260512194634.58145-3-bvanassche@acm.org>
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?
Regards,
James
next prev parent reply other threads:[~2026-05-13 12: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 [this message]
2026-05-13 17:49 ` 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=b9b20ed6506ccd0d525abbd9da1f54c65ba76a8f.camel@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=brian@purestorage.com \
--cc=bvanassche@acm.org \
--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