Linux USB
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: Alan Stern <stern@rowland.harvard.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	<linux-usb@vger.kernel.org>,
	<usb-storage@lists.one-eyed-alien.net>
Cc: <lvc-project@linuxtesting.org>
Subject: Re: [PATCH v2] usb: storage: isd200: fix sloppy typing in isd200_scsi_to_ata()
Date: Sat, 23 Mar 2024 22:59:35 +0300	[thread overview]
Message-ID: <6b2428d3-294e-6f5a-2106-0833746df3d1@omp.ru> (raw)
In-Reply-To: <8d6beef7-5995-c831-a7b6-ff98d3887231@omp.ru>

On 3/23/24 10:55 PM, Sergey Shtylyov wrote:

> When isd200_scsi_to_ata() emulates the SCSI READ/WRITE (10) commands,
> the LBA is a 32-bit CDB field and the transfer length is a 16-bit CDB
> field, so using *unsigned long* (which is 32-bit type on the 32-bit
> arches and 64-bit type on the 64-bit arches) to declare the lba and
> blockCount variables doesn't make much sense.  Also, when it emulates
> the READ CAPACITY command, the returned LBA is a 32-bit parameter data
> field and the ATA device CHS mode capacity fits into 32 bits as well,

   Oops, it should have been s/CHS mode//... :-/

> so using *unsigned long* to declare the capacity variable doesn't make
> much sense as well. Let's use the u16/u32 types for those variables...
> 
> Found by Linux Verification Center (linuxtesting.org) with the SVACE
> static analysis tool.
> 
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

[...]

MBR, Sergey


  reply	other threads:[~2024-03-23 19:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-23 19:55 [PATCH v2] usb: storage: isd200: fix sloppy typing in isd200_scsi_to_ata() Sergey Shtylyov
2024-03-23 19:59 ` Sergey Shtylyov [this message]
2024-03-24  1:16 ` Alan Stern

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=6b2428d3-294e-6f5a-2106-0833746df3d1@omp.ru \
    --to=s.shtylyov@omp.ru \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=stern@rowland.harvard.edu \
    --cc=usb-storage@lists.one-eyed-alien.net \
    /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