Skip to content

Commit

Permalink
scsi: ufs: Use get_unaligned_be16() instead of be16_to_cpup()
Browse files Browse the repository at this point in the history
Use get_unaligned_be16(...) instead of the equivalent but harder to read
be16_to_cpup((__be16 *)...).

Link: https://lore.kernel.org/r/[email protected]
Tested-by: Bean Huo <[email protected]>
Reviewed-by: Bean Huo <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
bvanassche authored and martinkpetersen committed Apr 26, 2022
1 parent 1de4378 commit 9d3ab17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/ufs/ufshcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -7334,7 +7334,7 @@ static u32 ufshcd_get_max_icc_level(int sup_curr_uA, u32 start_scan, char *buff)
u16 unit;

for (i = start_scan; i >= 0; i--) {
data = be16_to_cpup((__be16 *)&buff[2 * i]);
data = get_unaligned_be16(&buff[2 * i]);
unit = (data & ATTR_ICC_LVL_UNIT_MASK) >>
ATTR_ICC_LVL_UNIT_OFFSET;
curr_uA = data & ATTR_ICC_LVL_VALUE_MASK;
Expand Down

0 comments on commit 9d3ab17

Please sign in to comment.