From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752380AbcFPGjS (ORCPT ); Thu, 16 Jun 2016 02:39:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44914 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751300AbcFPGjR (ORCPT ); Thu, 16 Jun 2016 02:39:17 -0400 Date: Thu, 16 Jun 2016 08:39:12 +0200 From: Jiri Olsa To: He Kuang Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, wangnan0@huawei.com, adrian.hunter@intel.com, ak@linux.intel.com, maddy@linux.vnet.ibm.com, bp@suse.de, dsahern@gmail.com, linux@horizon.com, namhyung@kernel.org, linux@rasmusvillemoes.dk, yury.norov@gmail.com, mpe@ellerman.id.au, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 2/2] tools include: Fix wrong macro definitions for cpu_to_le* for big endian Message-ID: <20160616063912.GB9533@krava> References: <20160615212958.GC4882@kernel.org> <1466040729-100926-1-git-send-email-hekuang@huawei.com> <1466040729-100926-3-git-send-email-hekuang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1466040729-100926-3-git-send-email-hekuang@huawei.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 16 Jun 2016 06:39:17 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 16, 2016 at 01:32:09AM +0000, He Kuang wrote: > From: Wang Nan > > The cpu_to_le* macros in kernel.h are defined without considering > endianese. This patch includes "byteoder/generic.h" instead to fix the > bug, and removes redundant le64_to_cpu definition in intel-bts.c. > > Signed-off-by: Wang Nan > Signed-off-by: He Kuang > --- > tools/include/linux/kernel.h | 5 ++--- > tools/perf/util/intel-bts.c | 5 ----- > 2 files changed, 2 insertions(+), 8 deletions(-) > > diff --git a/tools/include/linux/kernel.h b/tools/include/linux/kernel.h > index 76df535..6145e41 100644 > --- a/tools/include/linux/kernel.h > +++ b/tools/include/linux/kernel.h > @@ -64,11 +64,10 @@ > #endif > > /* > - * Both need more care to handle endianness > + * Need more care to handle endianness > * (Don't use bitmap_copy_le() for now) what's the purpose of this comment now? > */ > -#define cpu_to_le64(x) (x) > -#define cpu_to_le32(x) (x) > +#include > > static inline int > vscnprintf(char *buf, size_t size, const char *fmt, va_list args) > diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c > index 9df9960..0e632c4 100644 > --- a/tools/perf/util/intel-bts.c > +++ b/tools/perf/util/intel-bts.c > @@ -40,11 +40,6 @@ > #define INTEL_BTS_ERR_NOINSN 5 > #define INTEL_BTS_ERR_LOST 9 > > -#if __BYTE_ORDER == __BIG_ENDIAN > -#define le64_to_cpu bswap_64 > -#else > -#define le64_to_cpu > -#endif the purpose of this patchset is to unify these macros right? there're more conversion defines in: util/intel-pt-decoder/intel-pt-pkt-decoder.c, please remove them as well thanks, jirka