From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759486AbcBYG1S (ORCPT ); Thu, 25 Feb 2016 01:27:18 -0500 Received: from torg.zytor.com ([198.137.202.12]:54860 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759264AbcBYG1P (ORCPT ); Thu, 25 Feb 2016 01:27:15 -0500 X-Greylist: delayed 2688 seconds by postgrey-1.27 at vger.kernel.org; Thu, 25 Feb 2016 01:27:08 EST Date: Wed, 24 Feb 2016 21:43:20 -0800 From: tip-bot for Jiri Olsa Message-ID: Cc: ak@linux.intel.com, tglx@linutronix.de, mingo@kernel.org, dsahern@gmail.com, hpa@zytor.com, namhyung@kernel.org, jolsa@kernel.org, a.p.zijlstra@chello.nl, acme@redhat.com, linux-kernel@vger.kernel.org, eranian@google.com Reply-To: acme@redhat.com, eranian@google.com, linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, tglx@linutronix.de, dsahern@gmail.com, mingo@kernel.org, hpa@zytor.com, ak@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org In-Reply-To: <1455525293-8671-13-git-send-email-jolsa@kernel.org> References: <1455525293-8671-13-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Use ARRAY_SIZE in mem sort display functions Git-Commit-ID: b19a1b6a233ede3ffc379b49e3653d6ce80dd743 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: b19a1b6a233ede3ffc379b49e3653d6ce80dd743 Gitweb: http://git.kernel.org/tip/b19a1b6a233ede3ffc379b49e3653d6ce80dd743 Author: Jiri Olsa AuthorDate: Mon, 15 Feb 2016 09:34:42 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 23 Feb 2016 12:19:10 -0300 perf tools: Use ARRAY_SIZE in mem sort display functions There's no need to define extra macros for that. Signed-off-by: Jiri Olsa Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1455525293-8671-13-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/sort.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 5f94ee7..5388f79 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -838,7 +838,6 @@ static const char * const tlb_access[] = { "Walker", "Fault", }; -#define NUM_TLB_ACCESS (sizeof(tlb_access)/sizeof(const char *)) static int hist_entry__tlb_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width) @@ -860,7 +859,7 @@ static int hist_entry__tlb_snprintf(struct hist_entry *he, char *bf, /* already taken care of */ m &= ~(PERF_MEM_TLB_HIT|PERF_MEM_TLB_MISS); - for (i = 0; m && i < NUM_TLB_ACCESS; i++, m >>= 1) { + for (i = 0; m && i < ARRAY_SIZE(tlb_access); i++, m >>= 1) { if (!(m & 0x1)) continue; if (l) { @@ -915,7 +914,6 @@ static const char * const mem_lvl[] = { "I/O", "Uncached", }; -#define NUM_MEM_LVL (sizeof(mem_lvl)/sizeof(const char *)) static int hist_entry__lvl_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width) @@ -937,7 +935,7 @@ static int hist_entry__lvl_snprintf(struct hist_entry *he, char *bf, /* already taken care of */ m &= ~(PERF_MEM_LVL_HIT|PERF_MEM_LVL_MISS); - for (i = 0; m && i < NUM_MEM_LVL; i++, m >>= 1) { + for (i = 0; m && i < ARRAY_SIZE(mem_lvl); i++, m >>= 1) { if (!(m & 0x1)) continue; if (l) { @@ -983,7 +981,6 @@ static const char * const snoop_access[] = { "Hit", "HitM", }; -#define NUM_SNOOP_ACCESS (sizeof(snoop_access)/sizeof(const char *)) static int hist_entry__snoop_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width) @@ -998,7 +995,7 @@ static int hist_entry__snoop_snprintf(struct hist_entry *he, char *bf, if (he->mem_info) m = he->mem_info->data_src.mem_snoop; - for (i = 0; m && i < NUM_SNOOP_ACCESS; i++, m >>= 1) { + for (i = 0; m && i < ARRAY_SIZE(snoop_access); i++, m >>= 1) { if (!(m & 0x1)) continue; if (l) {