2018-11-15 12:14:32

by Ioana Ciornei

[permalink] [raw]
Subject: [PATCH RESEND] bus: fsl-mc: explicitly define the fsl_mc_command endianness

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 <[email protected]>
Reviewed-by: Laurentiu Tudor <[email protected]>
---
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 9d3f668..741f567 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



2018-11-27 19:30:09

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH RESEND] bus: fsl-mc: explicitly define the fsl_mc_command endianness

On Thu, Nov 15, 2018 at 12:12:12PM +0000, 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 <[email protected]>
> Reviewed-by: Laurentiu Tudor <[email protected]>
> ---
> include/linux/fsl/mc.h | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)

What tree is this made against? I can't seem to apply it to any of mine
:(

Any hints?

thanks,

greg k-h

2018-11-29 14:11:33

by Ioana Ciornei

[permalink] [raw]
Subject: RE: [PATCH RESEND] bus: fsl-mc: explicitly define the fsl_mc_command endianness

> > 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 <[email protected]>
> > Reviewed-by: Laurentiu Tudor <[email protected]>
> > ---
> > include/linux/fsl/mc.h | 12 ++++++------
> > 1 file changed, 6 insertions(+), 6 deletions(-)
>
> What tree is this made against? I can't seem to apply it to any of mine :(
>

This was generated against a clean 4.20-rc1 but I just checked and I could apply it on both staging-next and driver-core-next.
Am I missing something?

Ioana

> Any hints?
>
> thanks,
>
> greg k-h