All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] firmware: raspberrypi: Fix type assignment
@ 2023-01-02 11:52 Maxime Ripard
  2023-01-03 23:44 ` Florian Fainelli
  2023-01-10 21:44 ` Florian Fainelli
  0 siblings, 2 replies; 4+ messages in thread
From: Maxime Ripard @ 2023-01-02 11:52 UTC (permalink / raw)
  To: Florian Fainelli, Ray Jui, Scott Branden
  Cc: bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel,
	Maxime Ripard, kernel test robot

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>
---
 include/soc/bcm2835/raspberrypi-firmware.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h
index ab955591cb72..73cac8d0287e 100644
--- a/include/soc/bcm2835/raspberrypi-firmware.h
+++ b/include/soc/bcm2835/raspberrypi-firmware.h
@@ -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)
-- 
2.38.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND] firmware: raspberrypi: Fix type assignment
  2023-01-02 11:52 [PATCH RESEND] firmware: raspberrypi: Fix type assignment Maxime Ripard
@ 2023-01-03 23:44 ` Florian Fainelli
  2023-01-04 12:57   ` Maxime Ripard
  2023-01-10 21:44 ` Florian Fainelli
  1 sibling, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2023-01-03 23:44 UTC (permalink / raw)
  To: Maxime Ripard, Florian Fainelli, Ray Jui, Scott Branden
  Cc: bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel,
	kernel test robot

On 1/2/23 03:52, Maxime Ripard wrote:
> 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>

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

> ---
>   include/soc/bcm2835/raspberrypi-firmware.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h
> index ab955591cb72..73cac8d0287e 100644
> --- a/include/soc/bcm2835/raspberrypi-firmware.h
> +++ b/include/soc/bcm2835/raspberrypi-firmware.h
> @@ -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)

-- 
Florian


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND] firmware: raspberrypi: Fix type assignment
  2023-01-03 23:44 ` Florian Fainelli
@ 2023-01-04 12:57   ` Maxime Ripard
  0 siblings, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2023-01-04 12:57 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Ray Jui, Scott Branden, bcm-kernel-feedback-list,
	linux-rpi-kernel, linux-arm-kernel, kernel test robot

Hi Florian,

On Tue, Jan 03, 2023 at 03:44:24PM -0800, Florian Fainelli wrote:
> On 1/2/23 03:52, Maxime Ripard wrote:
> > 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>
> 
> 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
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND] firmware: raspberrypi: Fix type assignment
  2023-01-02 11:52 [PATCH RESEND] firmware: raspberrypi: Fix type assignment Maxime Ripard
  2023-01-03 23:44 ` Florian Fainelli
@ 2023-01-10 21:44 ` Florian Fainelli
  1 sibling, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2023-01-10 21:44 UTC (permalink / raw)
  To: bcm-kernel-feedback-list, Maxime Ripard, Ray Jui, Scott Branden
  Cc: linux-rpi-kernel, linux-arm-kernel, kernel test robot

On Mon,  2 Jan 2023 12:52:55 +0100, Maxime Ripard <maxime@cerno.tech> wrote:
> 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>
> ---

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-10 21:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-02 11:52 [PATCH RESEND] firmware: raspberrypi: Fix type assignment Maxime Ripard
2023-01-03 23:44 ` Florian Fainelli
2023-01-04 12:57   ` Maxime Ripard
2023-01-10 21:44 ` Florian Fainelli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.