Skip to content

Commit 290d161

Browse files
committed
Revert "drm/i915: use localized __diag_ignore_all() instead of per file"
This reverts commit 88e9664. __diag_ignore_all() only works for GCC 8 or later. -Woverride-init (from -Wextra, enabled in i915 Makefile) combined with CONFIG_WERROR=y or W=e breaks the build for older GCC. With i386_defconfig and x86_64_defconfig enabling CONFIG_WERROR=y by default, we really need to roll back the change. An alternative would be to disable -Woverride-init in the Makefile for GCC <8, but the revert seems like the safest bet now. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8768 Reported-by: John Garry <[email protected]> References: https://lore.kernel.org/r/[email protected] References: https://lore.kernel.org/r/[email protected] Fixes: 88e9664 ("drm/i915: use localized __diag_ignore_all() instead of per file") Cc: Gustavo Sousa <[email protected]> Cc: Joonas Lahtinen <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Reviewed-by: Gustavo Sousa <[email protected]> Tested-by: John Garry <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 8df6144 commit 290d161

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

drivers/gpu/drm/i915/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable)
2323
subdir-ccflags-y += $(call cc-disable-warning, frame-address)
2424
subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
2525

26+
# Fine grained warnings disable
27+
CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init)
28+
CFLAGS_display/intel_display_device.o = $(call cc-disable-warning, override-init)
29+
CFLAGS_display/intel_fbdev.o = $(call cc-disable-warning, override-init)
30+
2631
subdir-ccflags-y += -I$(srctree)/$(src)
2732

2833
# Please keep these build lists sorted!

drivers/gpu/drm/i915/display/intel_display_device.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
#include "intel_display_reg_defs.h"
1717
#include "intel_fbc.h"
1818

19-
__diag_push();
20-
__diag_ignore_all("-Woverride-init", "Allow overriding inherited members");
21-
2219
static const struct intel_display_device_info no_display = {};
2320

2421
#define PIPE_A_OFFSET 0x70000
@@ -727,8 +724,6 @@ static const struct intel_display_device_info xe_lpdp_display = {
727724
BIT(PORT_TC1) | BIT(PORT_TC2) | BIT(PORT_TC3) | BIT(PORT_TC4),
728725
};
729726

730-
__diag_pop();
731-
732727
#undef INTEL_VGA_DEVICE
733728
#undef INTEL_QUANTA_VGA_DEVICE
734729
#define INTEL_VGA_DEVICE(id, info) { id, info }

drivers/gpu/drm/i915/display/intel_fbdev.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
135135
return i915_gem_fb_mmap(obj, vma);
136136
}
137137

138-
__diag_push();
139-
__diag_ignore_all("-Woverride-init", "Allow overriding the default ops");
140-
141138
static const struct fb_ops intelfb_ops = {
142139
.owner = THIS_MODULE,
143140
__FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev),
@@ -149,8 +146,6 @@ static const struct fb_ops intelfb_ops = {
149146
.fb_mmap = intel_fbdev_mmap,
150147
};
151148

152-
__diag_pop();
153-
154149
static int intelfb_alloc(struct drm_fb_helper *helper,
155150
struct drm_fb_helper_surface_size *sizes)
156151
{

drivers/gpu/drm/i915/i915_pci.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838
#include "i915_reg.h"
3939
#include "intel_pci_config.h"
4040

41-
__diag_push();
42-
__diag_ignore_all("-Woverride-init", "Allow overriding inherited members");
43-
4441
#define PLATFORM(x) .platform = (x)
4542
#define GEN(x) \
4643
.__runtime.graphics.ip.ver = (x), \
@@ -846,8 +843,6 @@ static const struct intel_device_info mtl_info = {
846843

847844
#undef PLATFORM
848845

849-
__diag_pop();
850-
851846
/*
852847
* Make sure any device matches here are from most specific to most
853848
* general. For example, since the Quanta match is based on the subsystem

0 commit comments

Comments
 (0)