Skip to content

Commit

Permalink
ata: libata-scsi: Refactor scsi_6_lba_len() with use of get_unaligned…
Browse files Browse the repository at this point in the history
…_be24()

Refactor scsi_6_lba_len() with use of get_unaligned_be24() to make it
consistent with other similar helper implementations.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  • Loading branch information
andy-shev authored and intel-lab-lkp committed Jul 26, 2022
1 parent e0dccc3 commit ae9a00d
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions drivers/ata/libata-scsi.c
Expand Up @@ -1317,17 +1317,8 @@ static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc)
*/
static void scsi_6_lba_len(const u8 *cdb, u64 *plba, u32 *plen)
{
u64 lba = 0;
u32 len;

lba |= ((u64)(cdb[1] & 0x1f)) << 16;
lba |= ((u64)cdb[2]) << 8;
lba |= ((u64)cdb[3]);

len = cdb[4];

*plba = lba;
*plen = len;
*plba = get_unaligned_be24(cdb[1]) & 0x1fffff;
*plen = cdb[4];
}

/**
Expand Down

0 comments on commit ae9a00d

Please sign in to comment.