Commit d6ace935 authored by Jiri Slaby's avatar Jiri Slaby

x86: vvar, fix excessive gcc-6 DECLARE_VVAR warnings

On 3.12, with gcc-6, I see a lot of:
arch/x86/include/asm/vvar.h:33:28: warning: ‘vvaraddr_jiffies’ defined but not used [-Wunused-const-variable]
  static type const * const vvaraddr_ ## name =   \
                            ^
arch/x86/include/asm/vvar.h:46:1: note: in expansion of macro ‘DECLARE_VVAR’
 DECLARE_VVAR(0, volatile unsigned long, jiffies)
 ^~~~~~~~~~~~

In upstream, this is fixed by ef721987 (x86, vdso: Introduce VVAR
marco for vdso32) and f40c3300 (x86, vdso: Move the vvar and hpet
mappings next to the 64-bit vDSO). But this is not applicable to
stable.

So mark the vvar declaration as __maybe_unused and be done with it.
This will generate it to the code only if it is used. I.e. the same as
with gcc < 6.
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Cc: Andy Lutomirski <luto@amacapital.net>
parent 1fa9b58c
......@@ -30,7 +30,7 @@
#else
#define DECLARE_VVAR(offset, type, name) \
static type const * const vvaraddr_ ## name = \
static type const * const vvaraddr_ ## name __maybe_unused = \
(void *)(VVAR_ADDRESS + (offset));
#define DEFINE_VVAR(type, name) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment