x86/apic: silence compiler -Wtype-limits warnings
PATCH 1/1 x86/apic: silence compiler -Wtype-limits warnings
There are many compiler warnings like this,
In file included from ./arch/x86/include/asm/smp.h:13,
from ./arch/x86/include/asm/mmzone_64.h:11,
from ./arch/x86/include/asm/mmzone.h:5,
from ./include/linux/mmzone.h:969,
from ./include/linux/gfp.h:6,
from ./include/linux/mm.h:10,
from arch/x86/kernel/apic/io_apic.c:34:
arch/x86/kernel/apic/io_apic.c: In function 'check_timer':
./arch/x86/include/asm/apic.h:37:11: warning: comparison of unsigned
expression >= 0 is always true [-Wtype-limits]
if ((v) <= apic_verbosity) \
^~arch/x86/kernel/apic/io_apic.c:2160:2: note: in expansion of macro 'apic_printk'
apic_printk(APIC_QUIET, KERN_INFO "..TIMER: vector=0x%02X " ^~~~~~~~~~~./arch/x86/include/asm/apic.h:37:11: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
if ((v) <= apic_verbosity) \
^~arch/x86/kernel/apic/io_apic.c:2207:4: note: in expansion of macro 'apic_printk'
apic_printk(APIC_QUIET, KERN_ERR "..MP-BIOS bug: " ^~~~~~~~~~~
APIC_QUIET is 0, so silence them by making "apic_verbosity" an "int" which is a simpler fix than adding more checks in apic_printk().
--- arch/x86/include/asm/apic.h | 2 +- arch/x86/kernel/apic/apic.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/apic.h +1 -1
@@ -49,7 +49,7 @@ static inline void generic_apic_probe(void)#ifdef CONFIG_X86_LOCAL_APIC -extern unsigned int apic_verbosity; +extern int apic_verbosity;extern int local_apic_timer_c2_ok;extern int disable_apic;
arch/x86/kernel/apic/apic.c +1 -1
@@ -183,7 +183,7 @@ static __init int setup_apicpmtimer(char *s)/* * Debug level, exported for io_apic.c */ -unsigned int apic_verbosity; +int apic_verbosity;int pic_mode;
Signature · 1 line
1.8.3.1
tip-bot for Qian Cai
merge bot[tip:x86/urgent] x86/apic: Silence -Wtype-limits compiler warnings
x86/apic: Silence -Wtype-limits compiler warnings
Commit-ID: ec6335586953b0df32f83ef696002063090c7aef Gitweb: https://git.kernel.org/tip/ec6335586953b0df32f83ef696002063090c7aef Author: Qian Cai <[email protected]> AuthorDate: Mon, 8 Jul 2019 17:36:45 -0400 Committer: Thomas Gleixner <[email protected]> CommitDate: Tue, 16 Jul 2019 23:13:48 +0200
x86/apic: Silence -Wtype-limits compiler warnings
There are many compiler warnings like this,
In file included from ./arch/x86/include/asm/smp.h:13,
from ./arch/x86/include/asm/mmzone_64.h:11,
from ./arch/x86/include/asm/mmzone.h:5,
from ./include/linux/mmzone.h:969,
from ./include/linux/gfp.h:6,
from ./include/linux/mm.h:10,
from arch/x86/kernel/apic/io_apic.c:34:
arch/x86/kernel/apic/io_apic.c: In function 'check_timer':
./arch/x86/include/asm/apic.h:37:11: warning: comparison of unsigned
expression >= 0 is always true [-Wtype-limits]
if ((v) <= apic_verbosity) \
^~arch/x86/kernel/apic/io_apic.c:2160:2: note: in expansion of macro 'apic_printk'
apic_printk(APIC_QUIET, KERN_INFO "..TIMER: vector=0x%02X " ^~~~~~~~~~~./arch/x86/include/asm/apic.h:37:11: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
if ((v) <= apic_verbosity) \
^~arch/x86/kernel/apic/io_apic.c:2207:4: note: in expansion of macro 'apic_printk'
apic_printk(APIC_QUIET, KERN_ERR "..MP-BIOS bug: " ^~~~~~~~~~~
APIC_QUIET is 0, so silence them by making apic_verbosity type int.
--- arch/x86/include/asm/apic.h | 2 +- arch/x86/kernel/apic/apic.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/apic.h +1 -1
@@ -49,7 +49,7 @@ static inline void generic_apic_probe(void)#ifdef CONFIG_X86_LOCAL_APIC -extern unsigned int apic_verbosity; +extern int apic_verbosity;extern int local_apic_timer_c2_ok;extern int disable_apic;
arch/x86/kernel/apic/apic.c +1 -1
@@ -183,7 +183,7 @@ EXPORT_SYMBOL_GPL(local_apic_timer_c2_ok);/* * Debug level, exported for io_apic.c */ -unsigned int apic_verbosity; +int apic_verbosity;int pic_mode;