diff mbox series

[V1] mmc: core: Correction a warning caused by incorrect type in assignment for UHS-II

Message ID 20241105102901.351429-1-victorshihgli@gmail.com
State New
Headers show
Series [V1] mmc: core: Correction a warning caused by incorrect type in assignment for UHS-II | expand

Commit Message

Victor Shih Nov. 5, 2024, 10:29 a.m. UTC
From: Victor Shih <victor.shih@genesyslogic.com.tw>

There is a type issue in the assignment in the sd_uhs2_dev_init()
that will generate a warning when building the kernel.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202411051248.wvjHSFNj-lkp@intel.com/
Signed-off-by: Ben Chuang <ben.chuang@genesyslogic.com.tw>
Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw>
---
 drivers/mmc/core/sd_uhs2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Adrian Hunter Nov. 8, 2024, 7:44 a.m. UTC | #1
On 5/11/24 12:29, Victor Shih wrote:
> From: Victor Shih <victor.shih@genesyslogic.com.tw>
> 
> There is a type issue in the assignment in the sd_uhs2_dev_init()
> that will generate a warning when building the kernel.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202411051248.wvjHSFNj-lkp@intel.com/
> Signed-off-by: Ben Chuang <ben.chuang@genesyslogic.com.tw>
> Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw>

It is OK for now, so:

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

However it looks like in some other cases, the payload byte
order is wrong, but the value is zero which works anyway.
The UHS-II spec is a bit confusing because it says the DWORDs
are big endian, but the registers are 64-bits, so does that
mean the payload byte order is 3,2,1,0,7,6,5,4 ?

Perhaps someone could check.  I don't have time right now,
sorry.

> ---
>  drivers/mmc/core/sd_uhs2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/core/sd_uhs2.c b/drivers/mmc/core/sd_uhs2.c
> index c5847a2084d5..1c31d0dfa961 100644
> --- a/drivers/mmc/core/sd_uhs2.c
> +++ b/drivers/mmc/core/sd_uhs2.c
> @@ -181,7 +181,7 @@ static int sd_uhs2_dev_init(struct mmc_host *host)
>  			    UHS2_DEV_INIT_COMPLETE_FLAG |
>  			    ((gd & 0xF) << 4) |
>  			    (gap & 0xF);
> -		uhs2_cmd.payload[0] = payload0;
> +		uhs2_cmd.payload[0] = (__force __be32)payload0;
>  
>  		sd_uhs2_cmd_assemble(&cmd, &uhs2_cmd, UHS2_DEV_INIT_PAYLOAD_LEN,
>  				     UHS2_DEV_INIT_RESP_LEN);
diff mbox series

Patch

diff --git a/drivers/mmc/core/sd_uhs2.c b/drivers/mmc/core/sd_uhs2.c
index c5847a2084d5..1c31d0dfa961 100644
--- a/drivers/mmc/core/sd_uhs2.c
+++ b/drivers/mmc/core/sd_uhs2.c
@@ -181,7 +181,7 @@  static int sd_uhs2_dev_init(struct mmc_host *host)
 			    UHS2_DEV_INIT_COMPLETE_FLAG |
 			    ((gd & 0xF) << 4) |
 			    (gap & 0xF);
-		uhs2_cmd.payload[0] = payload0;
+		uhs2_cmd.payload[0] = (__force __be32)payload0;
 
 		sd_uhs2_cmd_assemble(&cmd, &uhs2_cmd, UHS2_DEV_INIT_PAYLOAD_LEN,
 				     UHS2_DEV_INIT_RESP_LEN);