Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit c40845e

Browse files
arndbmasahir0y
authored andcommitted
kbuild: make -Woverride-init warnings more consistent
The -Woverride-init warn about code that may be intentional or not, but the inintentional ones tend to be real bugs, so there is a bit of disagreement on whether this warning option should be enabled by default and we have multiple settings in scripts/Makefile.extrawarn as well as individual subsystems. Older versions of clang only supported -Wno-initializer-overrides with the same meaning as gcc's -Woverride-init, though all supported versions now work with both. Because of this difference, an earlier cleanup of mine accidentally turned the clang warning off for W=1 builds and only left it on for W=2, while it's still enabled for gcc with W=1. There is also one driver that only turns the warning off for newer versions of gcc but not other compilers, and some but not all the Makefiles still use a cc-disable-warning conditional that is no longer needed with supported compilers here. Address all of the above by removing the special cases for clang and always turning the warning off unconditionally where it got in the way, using the syntax that is supported by both compilers. Fixes: 2cd3271 ("kbuild: avoid duplicate warning options") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Andrew Jeffery <andrew@codeconstruct.com.au> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent 1102f9f commit c40845e

File tree

13 files changed

+18
-23
lines changed

13 files changed

+18
-23
lines changed

drivers/gpu/drm/amd/display/dc/dce110/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# Makefile for the 'controller' sub-component of DAL.
2424
# It provides the control and status of HW CRTC block.
2525

26-
CFLAGS_$(AMDDALPATH)/dc/dce110/dce110_resource.o = $(call cc-disable-warning, override-init)
26+
CFLAGS_$(AMDDALPATH)/dc/dce110/dce110_resource.o = -Wno-override-init
2727

2828
DCE110 = dce110_timing_generator.o \
2929
dce110_compressor.o dce110_opp_regamma_v.o \

drivers/gpu/drm/amd/display/dc/dce112/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# Makefile for the 'controller' sub-component of DAL.
2424
# It provides the control and status of HW CRTC block.
2525

26-
CFLAGS_$(AMDDALPATH)/dc/dce112/dce112_resource.o = $(call cc-disable-warning, override-init)
26+
CFLAGS_$(AMDDALPATH)/dc/dce112/dce112_resource.o = -Wno-override-init
2727

2828
DCE112 = dce112_compressor.o
2929

drivers/gpu/drm/amd/display/dc/dce120/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# It provides the control and status of HW CRTC block.
2525

2626

27-
CFLAGS_$(AMDDALPATH)/dc/dce120/dce120_resource.o = $(call cc-disable-warning, override-init)
27+
CFLAGS_$(AMDDALPATH)/dc/dce120/dce120_resource.o = -Wno-override-init
2828

2929
DCE120 = dce120_timing_generator.o
3030

drivers/gpu/drm/amd/display/dc/dce60/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# Makefile for the 'controller' sub-component of DAL.
2424
# It provides the control and status of HW CRTC block.
2525

26-
CFLAGS_$(AMDDALPATH)/dc/dce60/dce60_resource.o = $(call cc-disable-warning, override-init)
26+
CFLAGS_$(AMDDALPATH)/dc/dce60/dce60_resource.o = -Wno-override-init
2727

2828
DCE60 = dce60_timing_generator.o dce60_hw_sequencer.o \
2929
dce60_resource.o

drivers/gpu/drm/amd/display/dc/dce80/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# Makefile for the 'controller' sub-component of DAL.
2424
# It provides the control and status of HW CRTC block.
2525

26-
CFLAGS_$(AMDDALPATH)/dc/dce80/dce80_resource.o = $(call cc-disable-warning, override-init)
26+
CFLAGS_$(AMDDALPATH)/dc/dce80/dce80_resource.o = -Wno-override-init
2727

2828
DCE80 = dce80_timing_generator.o
2929

drivers/gpu/drm/i915/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ endif
3333
subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
3434

3535
# Fine grained warnings disable
36-
CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init)
37-
CFLAGS_display/intel_display_device.o = $(call cc-disable-warning, override-init)
38-
CFLAGS_display/intel_fbdev.o = $(call cc-disable-warning, override-init)
36+
CFLAGS_i915_pci.o = -Wno-override-init
37+
CFLAGS_display/intel_display_device.o = -Wno-override-init
38+
CFLAGS_display/intel_fbdev.o = -Wno-override-init
3939

4040
# Support compiling the display code separately for both i915 and xe
4141
# drivers. Define I915 when building i915.

drivers/gpu/drm/xe/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \
172172
-Ddrm_i915_gem_object=xe_bo \
173173
-Ddrm_i915_private=xe_device
174174

175-
CFLAGS_i915-display/intel_fbdev.o = $(call cc-disable-warning, override-init)
176-
CFLAGS_i915-display/intel_display_device.o = $(call cc-disable-warning, override-init)
175+
CFLAGS_i915-display/intel_fbdev.o = -Wno-override-init
176+
CFLAGS_i915-display/intel_display_device.o = -Wno-override-init
177177

178178
# Rule to build SOC code shared with i915
179179
$(obj)/i915-soc/%.o: $(srctree)/drivers/gpu/drm/i915/soc/%.c FORCE

drivers/net/ethernet/renesas/sh_eth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* the macros available to do this only define GCC 8.
5151
*/
5252
__diag_push();
53-
__diag_ignore(GCC, 8, "-Woverride-init",
53+
__diag_ignore_all("-Woverride-init",
5454
"logic to initialize all and then override some is OK");
5555
static const u16 sh_eth_offset_gigabit[SH_ETH_MAX_REGISTER_OFFSET] = {
5656
SH_ETH_OFFSET_DEFAULTS,

drivers/pinctrl/aspeed/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
# Aspeed pinctrl support
33

4-
ccflags-y += $(call cc-option,-Woverride-init)
4+
ccflags-y += -Woverride-init
55
obj-$(CONFIG_PINCTRL_ASPEED) += pinctrl-aspeed.o pinmux-aspeed.o
66
obj-$(CONFIG_PINCTRL_ASPEED_G4) += pinctrl-aspeed-g4.o
77
obj-$(CONFIG_PINCTRL_ASPEED_G5) += pinctrl-aspeed-g5.o

fs/proc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
obj-y += proc.o
77

8-
CFLAGS_task_mmu.o += $(call cc-option,-Wno-override-init,)
8+
CFLAGS_task_mmu.o += -Wno-override-init
99
proc-y := nommu.o task_nommu.o
1010
proc-$(CONFIG_MMU) := task_mmu.o
1111

0 commit comments

Comments
 (0)