[PATCH 2/2] soc: qcom: qcom_stats: Replace CLIENT_VOTES_OFFSET macro with sizeof()
From: Maulik Shah
Date: Thu Jul 30 2026 - 04:53:57 EST
CLIENT_VOTES_OFFSET (0x20) equals sizeof(struct sleep_stats), since
appended_stats immediately follows sleep_stats in the memory layout.
Replace the magic constant with sizeof(struct sleep_stats) to make
the layout relationship self-documenting and drop the macro.
No functional impact.
Assisted-by: Claude:claude-sonnet-4-6
Signed-off-by: Maulik Shah <maulik.shah@xxxxxxxxxxxxxxxx>
---
drivers/soc/qcom/qcom_stats.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/soc/qcom/qcom_stats.c b/drivers/soc/qcom/qcom_stats.c
index d9c811cb9ef6..06923408bfce 100644
--- a/drivers/soc/qcom/qcom_stats.c
+++ b/drivers/soc/qcom/qcom_stats.c
@@ -20,8 +20,6 @@
#define RPM_DYNAMIC_ADDR 0x14
#define RPM_DYNAMIC_ADDR_MASK 0xFFFF
-#define CLIENT_VOTES_OFFSET 0x20
-
#define DDR_STATS_MAGIC_KEY 0xA1157A75
#define DDR_STATS_MAX_NUM_MODES 20
#define DDR_STATS_MAGIC_KEY_ADDR 0x0
@@ -135,7 +133,7 @@ static int qcom_soc_sleep_stats_show(struct seq_file *s, void *unused)
if (d->appended_stats_avail) {
struct appended_stats votes;
- memcpy_fromio(&votes, reg + CLIENT_VOTES_OFFSET, sizeof(votes));
+ memcpy_fromio(&votes, reg + sizeof(struct sleep_stats), sizeof(votes));
seq_printf(s, "Client Votes: %#x\n", votes.client_votes);
}
--
2.43.0