staging: fsl-mc/dpio: Use __leXX types where needed
authorIoana Radulescu <ruxandra.radulescu@nxp.com>
Tue, 6 Mar 2018 17:43:46 +0000 (11:43 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Mar 2018 17:57:37 +0000 (09:57 -0800)
Structures that are mapped to hardware registers should explicitly
specify the expected endianness for fields larger than 1 byte.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
drivers/staging/fsl-mc/bus/dpio/qbman-portal.h

index 3522b9c0106b9f828fcfe00221b3a06d541a41c0..022baf5f39c872a5dd7bfb2f7e4b354babb8a392 100644 (file)
@@ -825,7 +825,7 @@ int qbman_swp_release(struct qbman_swp *s, const struct qbman_release_desc *d,
 struct qbman_acquire_desc {
        u8 verb;
        u8 reserved;
-       u16 bpid;
+       __le16 bpid;
        u8 num;
        u8 reserved2[59];
 };
@@ -833,10 +833,10 @@ struct qbman_acquire_desc {
 struct qbman_acquire_rslt {
        u8 verb;
        u8 rslt;
-       u16 reserved;
+       __le16 reserved;
        u8 num;
        u8 reserved2[3];
-       u64 buf[7];
+       __le64 buf[7];
 };
 
 /**
@@ -899,7 +899,7 @@ int qbman_swp_acquire(struct qbman_swp *s, u16 bpid, u64 *buffers,
 struct qbman_alt_fq_state_desc {
        u8 verb;
        u8 reserved[3];
-       u32 fqid;
+       __le32 fqid;
        u8 reserved2[56];
 };
 
@@ -948,11 +948,11 @@ int qbman_swp_alt_fq_state(struct qbman_swp *s, u32 fqid,
 struct qbman_cdan_ctrl_desc {
        u8 verb;
        u8 reserved;
-       u16 ch;
+       __le16 ch;
        u8 we;
        u8 ctrl;
-       u16 reserved2;
-       u64 cdan_ctx;
+       __le16 reserved2;
+       __le64 cdan_ctx;
        u8 reserved3[48];
 
 };
@@ -960,7 +960,7 @@ struct qbman_cdan_ctrl_desc {
 struct qbman_cdan_ctrl_rslt {
        u8 verb;
        u8 rslt;
-       u16 ch;
+       __le16 ch;
        u8 reserved[60];
 };
 
index fb8b9d35a3ebfccfb5429d31c07d9795cfc2c365..4488a445b7096b289b3b9a17c8625facf514a64b 100644 (file)
@@ -32,8 +32,8 @@ struct qbman_pull_desc {
        u8 numf;
        u8 tok;
        u8 reserved;
-       u32 dq_src;
-       u64 rsp_addr;
+       __le32 dq_src;
+       __le64 rsp_addr;
        u64 rsp_addr_virt;
        u8 padding[40];
 };
@@ -70,17 +70,17 @@ enum qbman_pull_type_e {
 struct qbman_eq_desc {
        u8 verb;
        u8 dca;
-       u16 seqnum;
-       u16 orpid;
-       u16 reserved1;
-       u32 tgtid;
-       u32 tag;
-       u16 qdbin;
+       __le16 seqnum;
+       __le16 orpid;
+       __le16 reserved1;
+       __le32 tgtid;
+       __le32 tag;
+       __le16 qdbin;
        u8 qpri;
        u8 reserved[3];
        u8 wae;
        u8 rspid;
-       u64 rsp_addr;
+       __le64 rsp_addr;
        u8 fd[32];
 };
 
@@ -88,9 +88,9 @@ struct qbman_eq_desc {
 struct qbman_release_desc {
        u8 verb;
        u8 reserved;
-       u16 bpid;
-       u32 reserved2;
-       u64 buf[7];
+       __le16 bpid;
+       __le32 reserved2;
+       __le64 buf[7];
 };
 
 /* Management command result codes */