Skip to content

Commit 23388a1

Browse files
Carl VanderlipMani-Sadhasivam
authored andcommitted
bus: mhi: host: Switch trace_mhi_gen_tre fields to native endian
Each of the __field() macros were triggering sparse warnings similar to: trace.h:87:1: sparse: sparse: cast to restricted __le64 trace.h:87:1: sparse: sparse: restricted __le64 degrades to integer trace.h:87:1: sparse: sparse: restricted __le64 degrades to integer Change each little endian type to its similarly sized native integer. Convert inputs into native endian. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: ceeb64f ("bus: mhi: host: Add tracing support") Signed-off-by: Carl Vanderlip <[email protected]> Reviewed-by: Jeffrey Hugo <[email protected]> Reviewed-by: Mayank Rana <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Manivannan Sadhasivam <[email protected]>
1 parent 8daf110 commit 23388a1

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

drivers/bus/mhi/host/trace.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#if !defined(_TRACE_EVENT_MHI_HOST_H) || defined(TRACE_HEADER_MULTI_READ)
1010
#define _TRACE_EVENT_MHI_HOST_H
1111

12+
#include <linux/byteorder/generic.h>
1213
#include <linux/tracepoint.h>
1314
#include <linux/trace_seq.h>
1415
#include "../common.h"
@@ -97,18 +98,18 @@ TRACE_EVENT(mhi_gen_tre,
9798
__string(name, mhi_cntrl->mhi_dev->name)
9899
__field(int, ch_num)
99100
__field(void *, wp)
100-
__field(__le64, tre_ptr)
101-
__field(__le32, dword0)
102-
__field(__le32, dword1)
101+
__field(uint64_t, tre_ptr)
102+
__field(uint32_t, dword0)
103+
__field(uint32_t, dword1)
103104
),
104105

105106
TP_fast_assign(
106107
__assign_str(name);
107108
__entry->ch_num = mhi_chan->chan;
108109
__entry->wp = mhi_tre;
109-
__entry->tre_ptr = mhi_tre->ptr;
110-
__entry->dword0 = mhi_tre->dword[0];
111-
__entry->dword1 = mhi_tre->dword[1];
110+
__entry->tre_ptr = le64_to_cpu(mhi_tre->ptr);
111+
__entry->dword0 = le32_to_cpu(mhi_tre->dword[0]);
112+
__entry->dword1 = le32_to_cpu(mhi_tre->dword[1]);
112113
),
113114

114115
TP_printk("%s: Chan: %d TRE: 0x%p TRE buf: 0x%llx DWORD0: 0x%08x DWORD1: 0x%08x\n",
@@ -176,19 +177,19 @@ DECLARE_EVENT_CLASS(mhi_process_event_ring,
176177

177178
TP_STRUCT__entry(
178179
__string(name, mhi_cntrl->mhi_dev->name)
179-
__field(__le32, dword0)
180-
__field(__le32, dword1)
180+
__field(uint32_t, dword0)
181+
__field(uint32_t, dword1)
181182
__field(int, state)
182-
__field(__le64, ptr)
183+
__field(uint64_t, ptr)
183184
__field(void *, rp)
184185
),
185186

186187
TP_fast_assign(
187188
__assign_str(name);
188189
__entry->rp = rp;
189-
__entry->ptr = rp->ptr;
190-
__entry->dword0 = rp->dword[0];
191-
__entry->dword1 = rp->dword[1];
190+
__entry->ptr = le64_to_cpu(rp->ptr);
191+
__entry->dword0 = le32_to_cpu(rp->dword[0]);
192+
__entry->dword1 = le32_to_cpu(rp->dword[1]);
192193
__entry->state = MHI_TRE_GET_EV_STATE(rp);
193194
),
194195

0 commit comments

Comments
 (0)