From patchwork Thu Jun 16 01:32:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: He Kuang X-Patchwork-Id: 70138 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp26598qgy; Wed, 15 Jun 2016 18:39:56 -0700 (PDT) X-Received: by 10.98.24.134 with SMTP id 128mr2094796pfy.52.1466041196759; Wed, 15 Jun 2016 18:39:56 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 186si2612985pfy.175.2016.06.15.18.39.56; Wed, 15 Jun 2016 18:39:56 -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 S933365AbcFPBjx (ORCPT + 30 others); Wed, 15 Jun 2016 21:39:53 -0400 Received: from szxga05-in.huawei.com ([119.145.14.199]:25124 "EHLO szxga05-in.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753224AbcFPBj3 (ORCPT ); Wed, 15 Jun 2016 21:39:29 -0400 Received: from 172.24.1.46 (EHLO lggeml425-hub.china.huawei.com) ([172.24.1.46]) by szxrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id BEL54129; Thu, 16 Jun 2016 09:19:47 +0800 (CST) Received: from euler.hulk-profiling (10.107.193.250) by lggeml425-hub.china.huawei.com (10.72.61.35) with Microsoft SMTP Server id 14.3.235.1; Thu, 16 Jun 2016 09:32:14 +0800 From: He Kuang To: , , , , , , , , , , , , , , , , CC: , Subject: [PATCH 2/2] tools include: Fix wrong macro definitions for cpu_to_le* for big endian Date: Thu, 16 Jun 2016 01:32:09 +0000 Message-ID: <1466040729-100926-3-git-send-email-hekuang@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1466040729-100926-1-git-send-email-hekuang@huawei.com> References: <20160615212958.GC4882@kernel.org> <1466040729-100926-1-git-send-email-hekuang@huawei.com> 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.0A090201.576201B0.00B3, 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: f0369af48be391d8bae8a1dc7f09e2d3 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.5.2 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;