[lvc-project] [PATCH v2] usb: storage: isd200: fix sloppy typing in isd200_scsi_to_ata()
Sergey Shtylyov
s.shtylyov at omp.ru
Sat Mar 23 22:59:35 MSK 2024
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 at omp.ru>
[...]
MBR, Sergey
More information about the lvc-project
mailing list