[PATCH v3] scsi: ufs: exynos: Use BIT() for the nexus type tag mask
From: shao.mingyin
Date: Tue Nov 03 2026 - 14:53:01 EST
From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
exynos_ufs_specify_nexus_t_xfer_req() and
exynos_ufs_specify_nexus_t_tm_req() set and clear the nexus type mask
with '(1 << tag)'. Commit 01aad16c2257 ("scsi: ufs: exynos: Fix
programming of HCI_UTRL_NEXUS_TYPE") converted the same expression in
exynos_ufs_post_link() to BIT() and noted that the UTMRL access should be
changed as well; the four remaining mask computations were missed.
Use BIT() there too, matching the rest of the driver. The transfer
request tag is in 0..nutrs-1, and nutrs can be 32, so BIT() makes the
width of the shift explicit; the task management tag is in 0..nutmrs-1
(at most 7), so only the transfer side can reach bit 31. No functional
change.
Signed-off-by: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
---
v3:
- Make this a standalone cleanup: no Fixes: and no Cc: stable. The
kernel is built with -fno-strict-overflow, under which GCC and Clang
both define the signed shift here and neither trips the shift
sanitizer, so there is no runtime bug to backport.
- nutrs counts UTP transfer request slots and nutmrs counts task
management request slots; only the former can be 32.
- Capitalize the subject verb.
drivers/ufs/host/ufs-exynos.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c
index 3bcbc9ebbb28..ee47958253bb 100644
--- a/drivers/ufs/host/ufs-exynos.c
+++ b/drivers/ufs/host/ufs-exynos.c
@@ -997,9 +997,9 @@ static void exynos_ufs_specify_nexus_t_xfer_req(struct ufs_hba *hba,
type = hci_readl(ufs, HCI_UTRL_NEXUS_TYPE);
if (is_scsi_cmd)
- hci_writel(ufs, type | (1 << tag), HCI_UTRL_NEXUS_TYPE);
+ hci_writel(ufs, type | BIT(tag), HCI_UTRL_NEXUS_TYPE);
else
- hci_writel(ufs, type & ~(1 << tag), HCI_UTRL_NEXUS_TYPE);
+ hci_writel(ufs, type & ~BIT(tag), HCI_UTRL_NEXUS_TYPE);
}
static void exynos_ufs_specify_nexus_t_tm_req(struct ufs_hba *hba,
@@ -1013,13 +1013,13 @@ static void exynos_ufs_specify_nexus_t_tm_req(struct ufs_hba *hba,
switch (func) {
case UFS_ABORT_TASK:
case UFS_QUERY_TASK:
- hci_writel(ufs, type | (1 << tag), HCI_UTMRL_NEXUS_TYPE);
+ hci_writel(ufs, type | BIT(tag), HCI_UTMRL_NEXUS_TYPE);
break;
case UFS_ABORT_TASK_SET:
case UFS_CLEAR_TASK_SET:
case UFS_LOGICAL_RESET:
case UFS_QUERY_TASK_SET:
- hci_writel(ufs, type & ~(1 << tag), HCI_UTMRL_NEXUS_TYPE);
+ hci_writel(ufs, type & ~BIT(tag), HCI_UTMRL_NEXUS_TYPE);
break;
}
}