[Intel-gfx] [PATCH] drm/i915/tc: Use standard ternary operator instead of GCC extension

Gil Dekel gildekel at chromium.org
Thu Jun 8 22:00:06 UTC 2023


The ternary expression:

  x ? : y

is a GCC extension and is not a part of C/C++ standard.

Use the canonical form instead to reduce dependency over GCC extension.

Signed-off-by: Gil Dekel <gildekel at chromium.org>
---
 drivers/gpu/drm/i915/display/intel_display_power_well.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_power_well.c b/drivers/gpu/drm/i915/display/intel_display_power_well.c
index 916009894d89c..39d0dbad589bf 100644
--- a/drivers/gpu/drm/i915/display/intel_display_power_well.c
+++ b/drivers/gpu/drm/i915/display/intel_display_power_well.c
@@ -255,7 +255,9 @@ static void hsw_wait_for_power_well_enable(struct drm_i915_private *dev_priv,
 {
 	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
 	int pw_idx = i915_power_well_instance(power_well)->hsw.idx;
-	int timeout = power_well->desc->enable_timeout ? : 1;
+	int timeout = power_well->desc->enable_timeout ?
+			      power_well->desc->enable_timeout :
+			      1;

 	/*
 	 * For some power wells we're not supposed to watch the status bit for
--
Gil Dekel, Software Engineer, Google / ChromeOS Display and Graphics


More information about the Intel-gfx mailing list