All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bus: fsl-mc: explicitly define the fsl_mc_command endianness
@ 2018-10-02 12:16 ` Ioana Ciornei
  0 siblings, 0 replies; 4+ messages in thread
From: Ioana Ciornei @ 2018-10-02 12:16 UTC (permalink / raw)
  To: gregkh, Leo Li, Laurentiu Tudor
  Cc: stuyoder, linux-kernel, Ioana Ciocoi Radulescu, arnd,
	linux-arm-kernel, devel, Ioana Ciornei

Both the header and the command parameters of the fsl_mc_command are
64-bit little-endian words. Use the appropriate type to explicitly
specify their endianness.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 include/linux/fsl/mc.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/fsl/mc.h b/include/linux/fsl/mc.h
index f27cb14..96c54bb 100644
--- a/include/linux/fsl/mc.h
+++ b/include/linux/fsl/mc.h
@@ -210,8 +210,8 @@ struct mc_cmd_header {
 };
 
 struct fsl_mc_command {
-	u64 header;
-	u64 params[MC_CMD_NUM_OF_PARAMS];
+	__le64 header;
+	__le64 params[MC_CMD_NUM_OF_PARAMS];
 };
 
 enum mc_cmd_status {
@@ -238,11 +238,11 @@ enum mc_cmd_status {
 /* Command completion flag */
 #define MC_CMD_FLAG_INTR_DIS	0x01
 
-static inline u64 mc_encode_cmd_header(u16 cmd_id,
-				       u32 cmd_flags,
-				       u16 token)
+static inline __le64 mc_encode_cmd_header(u16 cmd_id,
+					  u32 cmd_flags,
+					  u16 token)
 {
-	u64 header = 0;
+	__le64 header = 0;
 	struct mc_cmd_header *hdr = (struct mc_cmd_header *)&header;
 
 	hdr->cmd_id = cpu_to_le16(cmd_id);
-- 
1.9.1


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

* [PATCH] bus: fsl-mc: explicitly define the fsl_mc_command endianness
@ 2018-10-02 12:16 ` Ioana Ciornei
  0 siblings, 0 replies; 4+ messages in thread
From: Ioana Ciornei @ 2018-10-02 12:16 UTC (permalink / raw)
  To: linux-arm-kernel

Both the header and the command parameters of the fsl_mc_command are
64-bit little-endian words. Use the appropriate type to explicitly
specify their endianness.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 include/linux/fsl/mc.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/fsl/mc.h b/include/linux/fsl/mc.h
index f27cb14..96c54bb 100644
--- a/include/linux/fsl/mc.h
+++ b/include/linux/fsl/mc.h
@@ -210,8 +210,8 @@ struct mc_cmd_header {
 };
 
 struct fsl_mc_command {
-	u64 header;
-	u64 params[MC_CMD_NUM_OF_PARAMS];
+	__le64 header;
+	__le64 params[MC_CMD_NUM_OF_PARAMS];
 };
 
 enum mc_cmd_status {
@@ -238,11 +238,11 @@ enum mc_cmd_status {
 /* Command completion flag */
 #define MC_CMD_FLAG_INTR_DIS	0x01
 
-static inline u64 mc_encode_cmd_header(u16 cmd_id,
-				       u32 cmd_flags,
-				       u16 token)
+static inline __le64 mc_encode_cmd_header(u16 cmd_id,
+					  u32 cmd_flags,
+					  u16 token)
 {
-	u64 header = 0;
+	__le64 header = 0;
 	struct mc_cmd_header *hdr = (struct mc_cmd_header *)&header;
 
 	hdr->cmd_id = cpu_to_le16(cmd_id);
-- 
1.9.1

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

* Re: [PATCH] bus: fsl-mc: explicitly define the fsl_mc_command endianness
  2018-10-02 12:16 ` Ioana Ciornei
@ 2018-10-02 13:12   ` Laurentiu Tudor
  -1 siblings, 0 replies; 4+ messages in thread
From: Laurentiu Tudor @ 2018-10-02 13:12 UTC (permalink / raw)
  To: Ioana Ciornei, gregkh, Leo Li
  Cc: stuyoder, linux-kernel, Ioana Ciocoi Radulescu, arnd,
	linux-arm-kernel, devel


On 02.10.2018 15:16, Ioana Ciornei wrote:
> Both the header and the command parameters of the fsl_mc_command are
> 64-bit little-endian words. Use the appropriate type to explicitly
> specify their endianness.
> 
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>

Reviewed-By: Laurentiu Tudor <laurentiu.tudor@nxp.com>

---
Best Regards, Laurentiu

> ---
>   include/linux/fsl/mc.h | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/linux/fsl/mc.h b/include/linux/fsl/mc.h
> index f27cb14..96c54bb 100644
> --- a/include/linux/fsl/mc.h
> +++ b/include/linux/fsl/mc.h
> @@ -210,8 +210,8 @@ struct mc_cmd_header {
>   };
>   
>   struct fsl_mc_command {
> -	u64 header;
> -	u64 params[MC_CMD_NUM_OF_PARAMS];
> +	__le64 header;
> +	__le64 params[MC_CMD_NUM_OF_PARAMS];
>   };
>   
>   enum mc_cmd_status {
> @@ -238,11 +238,11 @@ enum mc_cmd_status {
>   /* Command completion flag */
>   #define MC_CMD_FLAG_INTR_DIS	0x01
>   
> -static inline u64 mc_encode_cmd_header(u16 cmd_id,
> -				       u32 cmd_flags,
> -				       u16 token)
> +static inline __le64 mc_encode_cmd_header(u16 cmd_id,
> +					  u32 cmd_flags,
> +					  u16 token)
>   {
> -	u64 header = 0;
> +	__le64 header = 0;
>   	struct mc_cmd_header *hdr = (struct mc_cmd_header *)&header;
>   
>   	hdr->cmd_id = cpu_to_le16(cmd_id);
> 

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

* [PATCH] bus: fsl-mc: explicitly define the fsl_mc_command endianness
@ 2018-10-02 13:12   ` Laurentiu Tudor
  0 siblings, 0 replies; 4+ messages in thread
From: Laurentiu Tudor @ 2018-10-02 13:12 UTC (permalink / raw)
  To: linux-arm-kernel


On 02.10.2018 15:16, Ioana Ciornei wrote:
> Both the header and the command parameters of the fsl_mc_command are
> 64-bit little-endian words. Use the appropriate type to explicitly
> specify their endianness.
> 
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>

Reviewed-By: Laurentiu Tudor <laurentiu.tudor@nxp.com>

---
Best Regards, Laurentiu

> ---
>   include/linux/fsl/mc.h | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/linux/fsl/mc.h b/include/linux/fsl/mc.h
> index f27cb14..96c54bb 100644
> --- a/include/linux/fsl/mc.h
> +++ b/include/linux/fsl/mc.h
> @@ -210,8 +210,8 @@ struct mc_cmd_header {
>   };
>   
>   struct fsl_mc_command {
> -	u64 header;
> -	u64 params[MC_CMD_NUM_OF_PARAMS];
> +	__le64 header;
> +	__le64 params[MC_CMD_NUM_OF_PARAMS];
>   };
>   
>   enum mc_cmd_status {
> @@ -238,11 +238,11 @@ enum mc_cmd_status {
>   /* Command completion flag */
>   #define MC_CMD_FLAG_INTR_DIS	0x01
>   
> -static inline u64 mc_encode_cmd_header(u16 cmd_id,
> -				       u32 cmd_flags,
> -				       u16 token)
> +static inline __le64 mc_encode_cmd_header(u16 cmd_id,
> +					  u32 cmd_flags,
> +					  u16 token)
>   {
> -	u64 header = 0;
> +	__le64 header = 0;
>   	struct mc_cmd_header *hdr = (struct mc_cmd_header *)&header;
>   
>   	hdr->cmd_id = cpu_to_le16(cmd_id);
> 

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

end of thread, other threads:[~2018-10-02 13:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-02 12:16 [PATCH] bus: fsl-mc: explicitly define the fsl_mc_command endianness Ioana Ciornei
2018-10-02 12:16 ` Ioana Ciornei
2018-10-02 13:12 ` Laurentiu Tudor
2018-10-02 13:12   ` Laurentiu Tudor

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.