Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1677545 > unrolled thread

[PATCH] perf/x86/intel: constify array lbr_desc and make a function static

Started byColin King <colin.king@canonical.com>
First post2017-06-29 11:20 +0200
Last post2017-06-30 15:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] perf/x86/intel: constify array lbr_desc and make a function static Colin King <colin.king@canonical.com> - 2017-06-29 11:20 +0200
    [tip:perf/core] perf/x86/intel: Constify the 'lbr_desc[]' array and  make a function static tip-bot for Colin Ian King <tipbot@zytor.com> - 2017-06-30 15:20 +0200

#1677545 — [PATCH] perf/x86/intel: constify array lbr_desc and make a function static

FromColin King <colin.king@canonical.com>
Date2017-06-29 11:20 +0200
Subject[PATCH] perf/x86/intel: constify array lbr_desc and make a function static
Message-ID<tXDMd-5II-3@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

A few minor clean-ups: constify array lbr_desc and make local
function lbr_from_signext_quirk_rd static to fix sparse warning:

"symbol 'lbr_from_signext_quirk_rd' was not declared. Should it be static?"

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 arch/x86/events/intel/lbr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c
index f924629836a8..eb261656a320 100644
--- a/arch/x86/events/intel/lbr.c
+++ b/arch/x86/events/intel/lbr.c
@@ -18,7 +18,7 @@ enum {
 	LBR_FORMAT_MAX_KNOWN    = LBR_FORMAT_TIME,
 };
 
-static enum {
+static const enum {
 	LBR_EIP_FLAGS		= 1,
 	LBR_TSX			= 2,
 } lbr_desc[LBR_FORMAT_MAX_KNOWN + 1] = {
@@ -287,7 +287,7 @@ inline u64 lbr_from_signext_quirk_wr(u64 val)
 /*
  * If quirk is needed, ensure sign extension is 61 bits:
  */
-u64 lbr_from_signext_quirk_rd(u64 val)
+static u64 lbr_from_signext_quirk_rd(u64 val)
 {
 	if (static_branch_unlikely(&lbr_from_quirk_key)) {
 		/*
-- 
2.11.0

[toc] | [next] | [standalone]


#1678824 — [tip:perf/core] perf/x86/intel: Constify the 'lbr_desc[]' array and make a function static

Fromtip-bot for Colin Ian King <tipbot@zytor.com>
Date2017-06-30 15:20 +0200
Subject[tip:perf/core] perf/x86/intel: Constify the 'lbr_desc[]' array and make a function static
Message-ID<tY404-5YH-61@gated-at.bofh.it>
In reply to#1677545
Commit-ID:  e91c8d97eac74e603481840d950536bcb62b471b
Gitweb:     http://git.kernel.org/tip/e91c8d97eac74e603481840d950536bcb62b471b
Author:     Colin Ian King <colin.king@canonical.com>
AuthorDate: Thu, 29 Jun 2017 10:14:06 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 30 Jun 2017 09:00:56 +0200

perf/x86/intel: Constify the 'lbr_desc[]' array and make a function static

A few minor clean-ups: constify the lbr_desc[] array and make
local function lbr_from_signext_quirk_rd() static to fix a sparse warning:

  "symbol 'lbr_from_signext_quirk_rd' was not declared. Should it be static?"

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kernel-janitors@vger.kernel.org
Link: http://lkml.kernel.org/r/20170629091406.9870-1-colin.king@canonical.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/events/intel/lbr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c
index f924629..eb26165 100644
--- a/arch/x86/events/intel/lbr.c
+++ b/arch/x86/events/intel/lbr.c
@@ -18,7 +18,7 @@ enum {
 	LBR_FORMAT_MAX_KNOWN    = LBR_FORMAT_TIME,
 };
 
-static enum {
+static const enum {
 	LBR_EIP_FLAGS		= 1,
 	LBR_TSX			= 2,
 } lbr_desc[LBR_FORMAT_MAX_KNOWN + 1] = {
@@ -287,7 +287,7 @@ inline u64 lbr_from_signext_quirk_wr(u64 val)
 /*
  * If quirk is needed, ensure sign extension is 61 bits:
  */
-u64 lbr_from_signext_quirk_rd(u64 val)
+static u64 lbr_from_signext_quirk_rd(u64 val)
 {
 	if (static_branch_unlikely(&lbr_from_quirk_key)) {
 		/*

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web