Skip to contentSkip to conversation

drivers/gpu/drm/i915/intel_guc_log.c: work around gcc-4.4.4 union initializer issue

PATCH In review [email protected] 2 participants 3 messages Mar 8, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/gpu/drm/i915/intel_guc_log.c: work around gcc-4.4.4 union initializer issue

From: Andrew Morton <[email protected]>
Subject: drivers/gpu/drm/i915/intel_guc_log.c: work around gcc-4.4.4 union initializer issue

gcc-4.4.4 has problems with initalizers of anon unions.

drivers/gpu/drm/i915/intel_guc_log.c: In function 'guc_log_control':
drivers/gpu/drm/i915/intel_guc_log.c:64: error: unknown field 'logging_enabled' specified in initializer

Work around this.

Fixes 35fe703c3161 ("drm/i915/guc: Change values for i915_guc_log_control")
Cc Michal Wajdeczko <[email protected]>
Cc Sagar Arun Kamble <[email protected]>
Cc Daniele Ceraolo Spurio <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Chris Wilson <[email protected]>

---

 drivers/gpu/drm/i915/intel_guc_log.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_guc_log.c renamed from drivers/gpu/drm/i915/intel_guc_log.c~drivers-gpu-drm-i915-intel_guc_logc-work-around-gcc-444-union-initializer-issue +4 -2
diff -puN drivers/gpu/drm/i915/intel_guc_log.c~drivers-gpu-drm-i915-intel_guc_logc-work-around-gcc-444-union-initializer-issue drivers/gpu/drm/i915/intel_guc_log.c
@@ -61,8 +61,10 @@ static int guc_log_flush(struct intel_gu
 static int guc_log_control(struct intel_guc *guc, bool enable, u32 verbosity)
 {
 	union guc_log_control control_val = {
-		.logging_enabled = enable,
-		.verbosity = verbosity,
+		{
+			.logging_enabled = enable,
+			.verbosity = verbosity,
+		},
 	};
 	u32 action[] = {
 		INTEL_GUC_ACTION_UK_LOG_ENABLE_LOGGING,

_
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#1 lore raw
Quoted 9 lines · On Wed, 07 Mar 2018, [email protected] wrote:

From: Andrew Morton <[email protected]>
Subject: drivers/gpu/drm/i915/intel_guc_log.c: work around gcc-4.4.4 union initializer issue

gcc-4.4.4 has problems with initalizers of anon unions.

drivers/gpu/drm/i915/intel_guc_log.c: In function 'guc_log_control':
drivers/gpu/drm/i915/intel_guc_log.c:64: error: unknown field 'logging_enabled' specified in initializer

Work around this.

Thanks for the patch, pushed to drm-intel-next-queued.

That said, how long do we have to care about old compilers? I thought we were converging on at the very least GCC 4.5 being required.

BR,
Jani.

Quoted 35 lines
Fixes 35fe703c3161 ("drm/i915/guc: Change values for i915_guc_log_control")
Cc Michal Wajdeczko <[email protected]>
Cc Sagar Arun Kamble <[email protected]>
Cc Daniele Ceraolo Spurio <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Chris Wilson <[email protected]>

---

 drivers/gpu/drm/i915/intel_guc_log.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff -puN drivers/gpu/drm/i915/intel_guc_log.c~drivers-gpu-drm-i915-intel_guc_logc-work-around-gcc-444-union-initializer-issue drivers/gpu/drm/i915/intel_guc_log.c

drivers/gpu/drm/i915/intel_guc_log.c renamed from drivers/gpu/drm/i915/intel_guc_log.c~drivers-gpu-drm-i915-intel_guc_logc-work-around-gcc-444-union-initializer-issue +4 -2
@@ -61,8 +61,10 @@ static int guc_log_flush(struct intel_gu
 static int guc_log_control(struct intel_guc *guc, bool enable, u32 verbosity)
 {
 	union guc_log_control control_val = {
-		.logging_enabled = enable,
-		.verbosity = verbosity,
+		{
+			.logging_enabled = enable,
+			.verbosity = verbosity,
+		},
 	};
 	u32 action[] = {
 		INTEL_GUC_ACTION_UK_LOG_ENABLE_LOGGING,

_
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
Quoted 9 lines · On Thu, 08 Mar 2018 12:06:46 +0200 Jani Nikula <[email protected]>…
Quoted 8 lines · On Wed, 07 Mar 2018, [email protected] wrote:

From: Andrew Morton <[email protected]>
Subject: drivers/gpu/drm/i915/intel_guc_log.c: work around gcc-4.4.4 union initializer issue

gcc-4.4.4 has problems with initalizers of anon unions.

drivers/gpu/drm/i915/intel_guc_log.c: In function 'guc_log_control':
drivers/gpu/drm/i915/intel_guc_log.c:64: error: unknown field 'logging_enabled' specified in initializer

Quoted 6 lines
Quoted 1 line

Work around this.

Thanks for the patch, pushed to drm-intel-next-queued.

That said, how long do we have to care about old compilers? I thought we were converging on at the very least GCC 4.5 being required.

Yes, I've seen some talk about that and it is about time for us to do it. I'm not sure what stage things are at though.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx