Skip to contentSkip to conversation

power: supply: qcom_battmgr: fix enable request endianness

PATCH Applied Johan Hovold 3 participants 3 messages Sep 29, 2023 – Sep 30, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: supply: qcom_battmgr: fix enable request endianness

Add the missing endianness conversion when sending the enable request so that the driver will work also on a hypothetical big-endian machine.

This issue was reported by sparse.

Fixes 29e8142b5623 ("power: supply: Introduce Qualcomm PMIC GLINK power supply")
Cc Bjorn Andersson <[email protected]>
---
 drivers/power/supply/qcom_battmgr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/power/supply/qcom_battmgr.c +3 -3
index de77df97b3a4..6ec71276bb70 100644
@@ -1282,9 +1282,9 @@ static void qcom_battmgr_enable_worker(struct work_struct *work)
 {
 	struct qcom_battmgr *battmgr = container_of(work, struct qcom_battmgr, enable_work);
 	struct qcom_battmgr_enable_request req = {
-		.hdr.owner = PMIC_GLINK_OWNER_BATTMGR,
-		.hdr.type = PMIC_GLINK_NOTIFY,
-		.hdr.opcode = BATTMGR_REQUEST_NOTIFICATION,
+		.hdr.owner = cpu_to_le32(PMIC_GLINK_OWNER_BATTMGR),
+		.hdr.type = cpu_to_le32(PMIC_GLINK_NOTIFY),
+		.hdr.opcode = cpu_to_le32(BATTMGR_REQUEST_NOTIFICATION),
 	};
 	int ret;
 
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Johan Hovold

Add the missing endianness conversion when sending the enable request so that the driver will work also on a hypothetical big-endian machine.

This issue was reported by sparse.

Fixes 29e8142b5623 ("power: supply: Introduce Qualcomm PMIC GLINK power supply")
Cc Bjorn Andersson <[email protected]>
#2 lore raw
In reply to Johan Hovold
Quoted 6 lines · Johan Hovold

Add the missing endianness conversion when sending the enable request so that the driver will work also on a hypothetical big-endian machine.

This issue was reported by sparse.

Applied, thanks!

[1/1] power: supply: qcom_battmgr: fix enable request endianness

      commit: 8894b432548851f705f72ff135d3dcbd442a18d1

Best regards,

Signature · 1 line
Sebastian Reichel <[email protected]>