Skip to contentSkip to conversation

firmware: raspberrypi: Fix type assignment

PATCH RESEND Applied Maxime Ripard 2 participants 4 messages Jan 2, 2023 – Jan 10, 2023

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

PATCH RESEND 1/1 firmware: raspberrypi: Fix type assignment

We silently cast an unsigned int into a __le32 which makes sparse complain. Moreover, we never actually convert endianness between the CPU's and the expected little-endian value. Fix both at once by calling cpu_to_le32().

Fixes 40c31955e4e9 ("firmware: raspberrypi: Provide a helper to query a clock max rate")
---
 include/soc/bcm2835/raspberrypi-firmware.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/soc/bcm2835/raspberrypi-firmware.h +1 -1
index ab955591cb72..73cac8d0287e 100644
@@ -170,7 +170,7 @@ struct rpi_firmware_clk_rate_request {
 
 #define RPI_FIRMWARE_CLK_RATE_REQUEST(_id)	\
 	{					\
-		.id = _id,			\
+		.id = cpu_to_le32(_id),		\
 	}
 
 #if IS_ENABLED(CONFIG_RASPBERRYPI_FIRMWARE)
Signature · 7 lines
2.38.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw
Quoted 9 lines · Maxime Ripard

We silently cast an unsigned int into a __le32 which makes sparse complain. Moreover, we never actually convert endianness between the CPU's and the expected little-endian value. Fix both at once by calling cpu_to_le32().

Fixes 40c31955e4e9 ("firmware: raspberrypi: Provide a helper to query a clock max rate")

As soon as v6.2-rc1 is cut, I will pick this up, thanks Maxime.

Quoted 17 lines
---
  include/soc/bcm2835/raspberrypi-firmware.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/soc/bcm2835/raspberrypi-firmware.h +1 -1
index ab955591cb72..73cac8d0287e 100644
@@ -170,7 +170,7 @@ struct rpi_firmware_clk_rate_request {
 
  #define RPI_FIRMWARE_CLK_RATE_REQUEST(_id)	\
  	{					\
-		.id = _id,			\
+		.id = cpu_to_le32(_id),		\
  	}
 
  #if IS_ENABLED(CONFIG_RASPBERRYPI_FIRMWARE)
Signature · 7 lines
Florian


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#2 lore raw

Hi Florian,

Quoted 6 lines · Florian Fainelli
Quoted 5 lines · Maxime Ripard

We silently cast an unsigned int into a __le32 which makes sparse complain. Moreover, we never actually convert endianness between the CPU's and the expected little-endian value. Fix both at once by calling cpu_to_le32().

Quoted 6 lines
Quoted 4 lines
Fixes 40c31955e4e9 ("firmware: raspberrypi: Provide a helper to query a clock max rate")

As soon as v6.2-rc1 is cut, I will pick this up, thanks Maxime.

I'm not sure what you mean, we're at -rc2 already?

Maxime

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#3 lore raw
In reply to Maxime Ripard
Quoted 10 lines · Maxime Ripard

We silently cast an unsigned int into a __le32 which makes sparse complain. Moreover, we never actually convert endianness between the CPU's and the expected little-endian value. Fix both at once by calling cpu_to_le32().

Fixes 40c31955e4e9 ("firmware: raspberrypi: Provide a helper to query a clock max rate")

---

Applied to https://github.com/Broadcom/stblinux/commits/drivers/fixes, thanks! --
Florian

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel