diff mbox series

[06/29] scsi: ufs: Use get_unaligned_be16() instead of be16_to_cpup()

Message ID 20220331223424.1054715-7-bvanassche@acm.org
State Superseded
Headers show
Series UFS patches for kernel v5.19 | expand

Commit Message

Bart Van Assche March 31, 2022, 10:34 p.m. UTC
Use get_unaligned_be16(...) instead of the equivalent but harder to read
be16_to_cpup((__be16 *)...).

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/ufs/ufshcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bean Huo April 3, 2022, 11:20 a.m. UTC | #1
On Thu, 2022-03-31 at 15:34 -0700, Bart Van Assche wrote:
> Use get_unaligned_be16(...) instead of the equivalent but harder to
> read
> be16_to_cpup((__be16 *)...).
> 
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Bean Huo <beanhuo@micron.com>
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index eddaa57b6aad..016734e987bf 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -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;