]> git.baikalelectronics.ru Git - kernel.git/commitdiff
scsi: ufs: Use get_unaligned_be16() instead of be16_to_cpup()
authorBart Van Assche <bvanassche@acm.org>
Tue, 19 Apr 2022 22:57:50 +0000 (15:57 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 26 Apr 2022 03:23:02 +0000 (23:23 -0400)
Use get_unaligned_be16(...) instead of the equivalent but harder to read
be16_to_cpup((__be16 *)...).

Link: https://lore.kernel.org/r/20220419225811.4127248-8-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c

index cb967fecd16d95f1ae770c4ce3ecb3731472936f..e400f28e54a3fd0ac6a9b2fa80a4d8f0eab06549 100644 (file)
@@ -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;