Re: [PATCH v1 1/1] ata: libata-scsi: Refactor scsi_6_lba_len() with use of get_unaligned_be24()

Christoph Hellwig
2022-07-26T17:55:49Z

On Tue, Jul 26, 2022 at 06:45:18PM +0300, Andy Shevchenko wrote:
> static void scsi_6_lba_len(const u8 *cdb, u64 *plba, u32 *plen)
> {
> + *plba = get_unaligned_be24(cdb[1]) & 0x1fffff;
> + *plen = cdb[4];

I think just pen coding this in the caller would be a lot cleaner.

Same for scsi_10_lba_len and scsi_16_lba_len in their two callers each.