From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933313AbcFPBje (ORCPT ); Wed, 15 Jun 2016 21:39:34 -0400 Received: from szxga05-in.huawei.com ([119.145.14.199]:24990 "EHLO szxga05-in.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932084AbcFPBjb (ORCPT ); Wed, 15 Jun 2016 21:39:31 -0400 From: He Kuang To: , , , , , , , , , , , , , , , , CC: , Subject: [PATCH] tools include: Fix wrong macro definitions for cpu_to_le* for big endian Date: Thu, 16 Jun 2016 01:32:07 +0000 Message-ID: <1466040729-100926-1-git-send-email-hekuang@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <20160615212958.GC4882@kernel.org> References: <20160615212958.GC4882@kernel.org> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.193.250] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090202.576201B1.0024,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: ec72f96d91a5d293b3f3dc124a52304a Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) */ -#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 struct intel_bts { struct auxtrace auxtrace; -- 1.8.3.4