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


Groups > linux.kernel > #1696620 > unrolled thread

[PATCH] x86/boot/compressed: Disable address-of-packed-member warning

Started byMatthias Kaehlcke <mka@chromium.org>
First post2017-07-26 00:00 +0200
Last post2017-07-28 09:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] x86/boot/compressed: Disable address-of-packed-member warning Matthias Kaehlcke <mka@chromium.org> - 2017-07-26 00:00 +0200
    [tip:x86/urgent] x86/boot: Disable the address-of-packed-member  compiler warning tip-bot for Matthias Kaehlcke <tipbot@zytor.com> - 2017-07-28 09:50 +0200

#1696620 — [PATCH] x86/boot/compressed: Disable address-of-packed-member warning

FromMatthias Kaehlcke <mka@chromium.org>
Date2017-07-26 00:00 +0200
Subject[PATCH] x86/boot/compressed: Disable address-of-packed-member warning
Message-ID<u7g1Y-8nQ-23@gated-at.bofh.it>
The clang warning 'address-of-packed-member' is disabled for the general
kernel code, also disable it for the x86 boot code.

This suppresses a bunch of warnings like this when building with clang:

./arch/x86/include/asm/processor.h:535:30: warning: taking address of
  packed member 'sp0' of class or structure 'x86_hw_tss' may result in an
  unaligned pointer value [-Waddress-of-packed-member]
    return this_cpu_read_stable(cpu_tss.x86_tss.sp0);
                                ^~~~~~~~~~~~~~~~~~~
./arch/x86/include/asm/percpu.h:391:59: note: expanded from macro
  'this_cpu_read_stable'
    #define this_cpu_read_stable(var)       percpu_stable_op("mov", var)
                                                                    ^~~
./arch/x86/include/asm/percpu.h:228:16: note: expanded from macro
  'percpu_stable_op'
    : "p" (&(var)));
             ^~~

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
 arch/x86/boot/compressed/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 2c860ad4fe06..8a958274b54c 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -34,6 +34,7 @@ KBUILD_CFLAGS += $(cflags-y)
 KBUILD_CFLAGS += -mno-mmx -mno-sse
 KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
 KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
+KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
 
 KBUILD_AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
 GCOV_PROFILE := n
-- 
2.14.0.rc0.400.g1c36432dff-goog

[toc] | [next] | [standalone]


#1698572 — [tip:x86/urgent] x86/boot: Disable the address-of-packed-member compiler warning

Fromtip-bot for Matthias Kaehlcke <tipbot@zytor.com>
Date2017-07-28 09:50 +0200
Subject[tip:x86/urgent] x86/boot: Disable the address-of-packed-member compiler warning
Message-ID<u88c2-N3-17@gated-at.bofh.it>
In reply to#1696620
Commit-ID:  20c6c189045539d29f4854d92b7ea9c329e1edfc
Gitweb:     http://git.kernel.org/tip/20c6c189045539d29f4854d92b7ea9c329e1edfc
Author:     Matthias Kaehlcke <mka@chromium.org>
AuthorDate: Tue, 25 Jul 2017 14:50:53 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 28 Jul 2017 08:39:08 +0200

x86/boot: Disable the address-of-packed-member compiler warning

The clang warning 'address-of-packed-member' is disabled for the general
kernel code, also disable it for the x86 boot code.

This suppresses a bunch of warnings like this when building with clang:

./arch/x86/include/asm/processor.h:535:30: warning: taking address of
  packed member 'sp0' of class or structure 'x86_hw_tss' may result in an
  unaligned pointer value [-Waddress-of-packed-member]
    return this_cpu_read_stable(cpu_tss.x86_tss.sp0);
                                ^~~~~~~~~~~~~~~~~~~
./arch/x86/include/asm/percpu.h:391:59: note: expanded from macro
  'this_cpu_read_stable'
    #define this_cpu_read_stable(var)       percpu_stable_op("mov", var)
                                                                    ^~~
./arch/x86/include/asm/percpu.h:228:16: note: expanded from macro
  'percpu_stable_op'
    : "p" (&(var)));
             ^~~

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Cc: Doug Anderson <dianders@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170725215053.135586-1-mka@chromium.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/boot/compressed/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 2c860ad..8a95827 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -34,6 +34,7 @@ KBUILD_CFLAGS += $(cflags-y)
 KBUILD_CFLAGS += -mno-mmx -mno-sse
 KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
 KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
+KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
 
 KBUILD_AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
 GCOV_PROFILE := n

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web