Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools lib traceevent: Provide le16toh define for older systems

Where such macro is not present, so just copy its definition from
glibc's endian.h and define it if not already.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/n/tip-4j90i2na07ppidt0z6cbuxr7@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+13
+13
tools/lib/traceevent/plugin_cfg80211.c
··· 4 4 #include <endian.h> 5 5 #include "event-parse.h" 6 6 7 + /* 8 + * From glibc endian.h, for older systems where it is not present, e.g.: RHEL5, 9 + * Fedora6. 10 + */ 11 + #ifndef le16toh 12 + # if __BYTE_ORDER == __LITTLE_ENDIAN 13 + # define le16toh(x) (x) 14 + # else 15 + # define le16toh(x) __bswap_16 (x) 16 + # endif 17 + #endif 18 + 19 + 7 20 static unsigned long long 8 21 process___le16_to_cpup(struct trace_seq *s, unsigned long long *args) 9 22 {