From patchwork Thu Jun 16 01:27:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: He Kuang X-Patchwork-Id: 70135 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp23372qgy; Wed, 15 Jun 2016 18:28:15 -0700 (PDT) X-Received: by 10.98.86.151 with SMTP id h23mr1928986pfj.137.1466040495838; Wed, 15 Jun 2016 18:28:15 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hu6si7120013pad.196.2016.06.15.18.28.15; Wed, 15 Jun 2016 18:28:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933216AbcFPB2N (ORCPT + 30 others); Wed, 15 Jun 2016 21:28:13 -0400 Received: from szxga04-in.huawei.com ([119.145.14.52]:43505 "EHLO szxga04-in.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753214AbcFPB2M (ORCPT ); Wed, 15 Jun 2016 21:28:12 -0400 Received: from 172.24.1.45 (EHLO lggeml423-hub.china.huawei.com) ([172.24.1.45]) by szxrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id BNP97250; Thu, 16 Jun 2016 09:17:21 +0800 (CST) Received: from euler.hulk-profiling (10.107.193.250) by lggeml423-hub.china.huawei.com (10.72.61.33) with Microsoft SMTP Server id 14.3.235.1; Thu, 16 Jun 2016 09:27:09 +0800 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:27:06 +0000 Message-ID: <1466040426-97061-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 X-Originating-IP: [10.107.193.250] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090206.57620080.006E, 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: 300df35ab92d7968bc3da53dc3c76612 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk 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(-) -- 1.8.3.4 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;