Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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")
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20221116091712.1309651-3-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20230102115255.17802-1-maxime@cerno.tech
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

authored by

Maxime Ripard and committed by
Florian Fainelli
a1904fa4 1b929c02

+1 -1
+1 -1
include/soc/bcm2835/raspberrypi-firmware.h
··· 170 170 171 171 #define RPI_FIRMWARE_CLK_RATE_REQUEST(_id) \ 172 172 { \ 173 - .id = _id, \ 173 + .id = cpu_to_le32(_id), \ 174 174 } 175 175 176 176 #if IS_ENABLED(CONFIG_RASPBERRYPI_FIRMWARE)