[Intel-gfx] [patch 1/1] drivers/gpu/drm/i915/selftests/i915_selftest.c: fix build with gcc-4.4.4
akpm at linux-foundation.org
akpm at linux-foundation.org
Thu Mar 9 23:47:37 UTC 2017
From: Andrew Morton <akpm at linux-foundation.org>
Subject: drivers/gpu/drm/i915/selftests/i915_selftest.c: fix build with gcc-4.4.4
gcc-4.4.4 has issues with anonymous union initializers.
In file included from drivers/gpu/drm/i915/selftests/i915_selftest.c:68:
drivers/gpu/drm/i915/selftests/i915_mock_selftests.h:11: error: unknown field 'mock' specified in initializer
drivers/gpu/drm/i915/selftests/i915_mock_selftests.h:11: warning: missing braces around initializer
drivers/gpu/drm/i915/selftests/i915_mock_selftests.h:11: warning: (near initialization for 'mock_selftests[0].<anonymous>')
drivers/gpu/drm/i915/selftests/i915_mock_selftests.h:12: error: unknown field 'mock' specified in initializer
drivers/gpu/drm/i915/selftests/i915_mock_selftests.h:13: error: unknown field 'm
...
Work around this.
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
---
drivers/gpu/drm/i915/selftests/i915_selftest.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -puN drivers/gpu/drm/i915/selftests/i915_selftest.c~drivers-gpu-drm-i915-selftests-i915_selftestc-fix-build-with-gcc-444 drivers/gpu/drm/i915/selftests/i915_selftest.c
--- a/drivers/gpu/drm/i915/selftests/i915_selftest.c~drivers-gpu-drm-i915-selftests-i915_selftestc-fix-build-with-gcc-444
+++ a/drivers/gpu/drm/i915/selftests/i915_selftest.c
@@ -63,13 +63,13 @@ struct selftest {
};
};
-#define selftest(n, f) [mock_##n] = { .name = #n, .mock = f },
+#define selftest(n, f) [mock_##n] = { .name = #n, { .mock = f } },
static struct selftest mock_selftests[] = {
#include "i915_mock_selftests.h"
};
#undef selftest
-#define selftest(n, f) [live_##n] = { .name = #n, .live = f },
+#define selftest(n, f) [live_##n] = { .name = #n, { .live = f } },
static struct selftest live_selftests[] = {
#include "i915_live_selftests.h"
};
_
More information about the Intel-gfx
mailing list