2019-07-17 13:15:10

by Zhenzhong Duan

[permalink] [raw]
Subject: [PATCH] x86/boot/compressed/64: Remove unused variable

Fix gcc warning:

arch/x86/boot/compressed/pgtable_64.c: In function 'find_trampoline_placement':
arch/x86/boot/compressed/pgtable_64.c:43:16: warning: unused variable 'trampoline_start' [-Wunused-variable]
unsigned long trampoline_start;
^

Signed-off-by: Zhenzhong Duan <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
---
arch/x86/boot/compressed/pgtable_64.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/x86/boot/compressed/pgtable_64.c b/arch/x86/boot/compressed/pgtable_64.c
index f8debf7..5f2d030 100644
--- a/arch/x86/boot/compressed/pgtable_64.c
+++ b/arch/x86/boot/compressed/pgtable_64.c
@@ -40,7 +40,6 @@ struct paging_config {
static unsigned long find_trampoline_placement(void)
{
unsigned long bios_start = 0, ebda_start = 0;
- unsigned long trampoline_start;
struct boot_e820_entry *entry;
char *signature;
int i;
--
1.8.3.1


2019-07-17 14:35:58

by Kirill A. Shutemov

[permalink] [raw]
Subject: Re: [PATCH] x86/boot/compressed/64: Remove unused variable

On Tue, Jul 16, 2019 at 01:17:20PM +0000, Zhenzhong Duan wrote:
> Fix gcc warning:
>
> arch/x86/boot/compressed/pgtable_64.c: In function 'find_trampoline_placement':
> arch/x86/boot/compressed/pgtable_64.c:43:16: warning: unused variable 'trampoline_start' [-Wunused-variable]
> unsigned long trampoline_start;
> ^
>
> Signed-off-by: Zhenzhong Duan <[email protected]>
> Cc: Kirill A. Shutemov <[email protected]>
> Cc: Peter Zijlstra <[email protected]>
> Cc: Thomas Gleixner <[email protected]>
> Cc: Ingo Molnar <[email protected]>
> Cc: Borislav Petkov <[email protected]>

Acked-by: Kirill A. Shutemov <[email protected]>

Have no idea why I don't see the warning in my setup.

--
Kirill A. Shutemov

2019-07-18 08:16:04

by Zhenzhong Duan

[permalink] [raw]
Subject: Re: [PATCH] x86/boot/compressed/64: Remove unused variable


On 2019/7/17 22:34, Kirill A. Shutemov wrote:
> On Tue, Jul 16, 2019 at 01:17:20PM +0000, Zhenzhong Duan wrote:
>> Fix gcc warning:
>>
>> arch/x86/boot/compressed/pgtable_64.c: In function 'find_trampoline_placement':
>> arch/x86/boot/compressed/pgtable_64.c:43:16: warning: unused variable 'trampoline_start' [-Wunused-variable]
>> unsigned long trampoline_start;
>> ^
>>
>> Signed-off-by: Zhenzhong Duan <[email protected]>
>> Cc: Kirill A. Shutemov <[email protected]>
>> Cc: Peter Zijlstra <[email protected]>
>> Cc: Thomas Gleixner <[email protected]>
>> Cc: Ingo Molnar <[email protected]>
>> Cc: Borislav Petkov <[email protected]>
> Acked-by: Kirill A. Shutemov <[email protected]>
>
> Have no idea why I don't see the warning in my setup.

Try below:

make bzImage EXTRA_CFLAGS="-Wunused-variable"

Zhenzhong

Subject: [tip:x86/urgent] x86/boot/compressed/64: Remove unused variable

Commit-ID: 449f328637e3ca62461da04d60ccb35aa5aa21dc
Gitweb: https://git.kernel.org/tip/449f328637e3ca62461da04d60ccb35aa5aa21dc
Author: Zhenzhong Duan <[email protected]>
AuthorDate: Tue, 16 Jul 2019 21:17:20 +0800
Committer: Thomas Gleixner <[email protected]>
CommitDate: Thu, 18 Jul 2019 21:41:57 +0200

x86/boot/compressed/64: Remove unused variable

Fix gcc warning:

arch/x86/boot/compressed/pgtable_64.c: In function 'find_trampoline_placement':
arch/x86/boot/compressed/pgtable_64.c:43:16: warning: unused variable 'trampoline_start' [-Wunused-variable]
unsigned long trampoline_start;
^

Signed-off-by: Zhenzhong Duan <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: Kirill A. Shutemov <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]

---
arch/x86/boot/compressed/pgtable_64.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/x86/boot/compressed/pgtable_64.c b/arch/x86/boot/compressed/pgtable_64.c
index f8debf7aeb4c..5f2d03067ae5 100644
--- a/arch/x86/boot/compressed/pgtable_64.c
+++ b/arch/x86/boot/compressed/pgtable_64.c
@@ -40,7 +40,6 @@ int cmdline_find_option_bool(const char *option);
static unsigned long find_trampoline_placement(void)
{
unsigned long bios_start = 0, ebda_start = 0;
- unsigned long trampoline_start;
struct boot_e820_entry *entry;
char *signature;
int i;