From: Arnaldo Carvalho de Melo Date: Thu, 14 May 2015 15:28:11 +0000 (-0300) Subject: tools lib traceevent: Provide le16toh define for older systems X-Git-Tag: v4.2-rc1~177^2~44^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b390d850607346162467bf1805a365e07de7c079;p=karo-tx-linux.git 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 Cc: Borislav Petkov Cc: David Ahern Cc: Don Zickus Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Cc: Steven Rostedt Link: http://lkml.kernel.org/n/tip-4j90i2na07ppidt0z6cbuxr7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/lib/traceevent/plugin_cfg80211.c b/tools/lib/traceevent/plugin_cfg80211.c index 4592d8438318..ec57d0c1fbc2 100644 --- a/tools/lib/traceevent/plugin_cfg80211.c +++ b/tools/lib/traceevent/plugin_cfg80211.c @@ -4,6 +4,19 @@ #include #include "event-parse.h" +/* + * From glibc endian.h, for older systems where it is not present, e.g.: RHEL5, + * Fedora6. + */ +#ifndef le16toh +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define le16toh(x) (x) +# else +# define le16toh(x) __bswap_16 (x) +# endif +#endif + + static unsigned long long process___le16_to_cpup(struct trace_seq *s, unsigned long long *args) {