public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: drop warning from mtrr: -Wunused-but-set-variable
@ 2019-02-08 12:53 Bo YU
  2019-02-08 13:37 ` [tip:x86/cleanups] x86/mtrr: Remove unused variable tip-bot for Bo Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Bo YU @ 2019-02-08 12:53 UTC (permalink / raw)
  To: tglx, mingo, bp, linux-kernel; +Cc: Bo Yu, hpa, x86, puwen

From: Bo Yu <tsu.yubo@gmail.com>

There is a warning if enable W=1 when compile kernel:

arch/x86/kernel/cpu/mtrr/cleanup.c:299:16: warning: variable ‘second_basek’ set but not used [-Wunused-but-set-variable]
  unsigned long second_basek, second_sizek;

Signed-off-by: Bo Yu <tsu.yubo@gmail.com>
---
 arch/x86/kernel/cpu/mtrr/cleanup.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c
index 3668c5df90c6..5bd011737272 100644
--- a/arch/x86/kernel/cpu/mtrr/cleanup.c
+++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
@@ -296,7 +296,7 @@ range_to_mtrr_with_hole(struct var_mtrr_state *state, unsigned long basek,
 			unsigned long sizek)
 {
 	unsigned long hole_basek, hole_sizek;
-	unsigned long second_basek, second_sizek;
+	unsigned long second_sizek;
 	unsigned long range0_basek, range0_sizek;
 	unsigned long range_basek, range_sizek;
 	unsigned long chunk_sizek;
@@ -304,7 +304,6 @@ range_to_mtrr_with_hole(struct var_mtrr_state *state, unsigned long basek,
 
 	hole_basek = 0;
 	hole_sizek = 0;
-	second_basek = 0;
 	second_sizek = 0;
 	chunk_sizek = state->chunk_sizek;
 	gran_sizek = state->gran_sizek;
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:x86/cleanups] x86/mtrr: Remove unused variable
  2019-02-08 12:53 [PATCH] x86: drop warning from mtrr: -Wunused-but-set-variable Bo YU
@ 2019-02-08 13:37 ` tip-bot for Bo Yu
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Bo Yu @ 2019-02-08 13:37 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: hpa, linux-kernel, tglx, mingo, tsu.yubo

Commit-ID:  c81cd5c08d676483bb09f4809660d2a1abea0062
Gitweb:     https://git.kernel.org/tip/c81cd5c08d676483bb09f4809660d2a1abea0062
Author:     Bo Yu <tsu.yubo@gmail.com>
AuthorDate: Fri, 8 Feb 2019 07:53:43 -0500
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 8 Feb 2019 14:32:33 +0100

x86/mtrr: Remove unused variable

Compiling the kernel with W=1 results in the following warning:

arch/x86/kernel/cpu/mtrr/cleanup.c:299:16: warning: variable ‘second_basek’ set but not used [-Wunused-but-set-variable]
  unsigned long second_basek, second_sizek;

Remove the unused variable.

[ tglx: Massaged changelog ]

Signed-off-by: Bo Yu <tsu.yubo@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@alien8.de
Cc: hpa@zytor.com
Cc: puwen@hygon.cn
Link: https://lkml.kernel.org/r/20190208125343.11451-1-tsu.yubo@gmail.com

---
 arch/x86/kernel/cpu/mtrr/cleanup.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c
index 3668c5df90c6..5bd011737272 100644
--- a/arch/x86/kernel/cpu/mtrr/cleanup.c
+++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
@@ -296,7 +296,7 @@ range_to_mtrr_with_hole(struct var_mtrr_state *state, unsigned long basek,
 			unsigned long sizek)
 {
 	unsigned long hole_basek, hole_sizek;
-	unsigned long second_basek, second_sizek;
+	unsigned long second_sizek;
 	unsigned long range0_basek, range0_sizek;
 	unsigned long range_basek, range_sizek;
 	unsigned long chunk_sizek;
@@ -304,7 +304,6 @@ range_to_mtrr_with_hole(struct var_mtrr_state *state, unsigned long basek,
 
 	hole_basek = 0;
 	hole_sizek = 0;
-	second_basek = 0;
 	second_sizek = 0;
 	chunk_sizek = state->chunk_sizek;
 	gran_sizek = state->gran_sizek;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-08 13:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-08 12:53 [PATCH] x86: drop warning from mtrr: -Wunused-but-set-variable Bo YU
2019-02-08 13:37 ` [tip:x86/cleanups] x86/mtrr: Remove unused variable tip-bot for Bo Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox