[PATCH] interconnect: qcom: fix endian annotations of BCM aux data

From: Rosen Penev

Date: Tue Sep 22 2026 - 14:28:37 EST


struct qcom_icc_bcm::aux_data stores the values parsed from the command
db, converted to native byte order, but is typed as the raw little-endian
struct bcm_db. Sparse therefore complains when the converted values are
assigned to the __le32/__le16 fields and when those restricted fields
are used in bandwidth calculations.

Give aux_data its own native-endian struct type so the parsed values are
stored with matching annotations, keeping struct bcm_db as the on-disk
format returned by cmd_db_read_aux_data(). No functional change.

Fixes: c96fc14322ce ("interconnect: qcom: add COMPILE_TEST")
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202609221350.3Y8MOce9-lkp@xxxxxxxxx/
Assisted-by: LLM
Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
---
drivers/interconnect/qcom/icc-rpmh.h | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/interconnect/qcom/icc-rpmh.h b/drivers/interconnect/qcom/icc-rpmh.h
index 09d8791402dc..30ec31eafcfb 100644
--- a/drivers/interconnect/qcom/icc-rpmh.h
+++ b/drivers/interconnect/qcom/icc-rpmh.h
@@ -45,6 +45,9 @@ struct qcom_icc_provider {
* @width: multiplier used to convert bytes/sec bw value to an RPMh msg
* @vcd: virtual clock domain that this bcm belongs to
* @reserved: reserved field
+ *
+ * This is the little-endian on-disk format returned by
+ * cmd_db_read_aux_data().
*/
struct bcm_db {
__le32 unit;
@@ -53,6 +56,20 @@ struct bcm_db {
u8 reserved;
};

+/**
+ * struct bcm_aux_data - Auxiliary data of a BCM in native byte order
+ * @unit: divisor used to convert bytes/sec bw value to an RPMh msg
+ * @width: multiplier used to convert bytes/sec bw value to an RPMh msg
+ * @vcd: virtual clock domain that this bcm belongs to
+ * @reserved: reserved field
+ */
+struct bcm_aux_data {
+ u32 unit;
+ u16 width;
+ u8 vcd;
+ u8 reserved;
+};
+
#define MAX_PORTS 4

/**
@@ -135,7 +152,7 @@ struct qcom_icc_bcm {
u32 enable_mask;
bool dirty;
bool keepalive;
- struct bcm_db aux_data;
+ struct bcm_aux_data aux_data;
struct list_head list;
struct list_head ws_list;
size_t num_nodes;
--
2.55.0