Skip to contentSkip to conversation

drm/i915/tc: Use standard ternary operator instead of GCC extension

PATCH In review Gil Dekel 3 participants 4 messages Jun 8, 2023 – Jun 10, 2023

Subsystems (3)
lore
Share & tools
lore

Gil Dekel

author
#0 lore raw

PATCH 1/1 drm/i915/tc: Use standard ternary operator instead of GCC extension

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.

---
 drivers/gpu/drm/i915/display/intel_display_power_well.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -1
index 916009894d89c..39d0dbad589bf 100644
@@ -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

#1 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/tc: Use standard ternary operator instead of GCC extension

== Series Details ==

== Series Details ==

Series: drm/i915/tc: Use standard ternary operator instead of GCC extension
URL : https://patchwork.freedesktop.org/series/119098/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13253 -> Patchwork_119098v1
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/index.html

Participating hosts (35 -> 35)
------------------------------

No changes in participating hosts

Known issues
------------

Here are the changes found in Patchwork_119098v1 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live@hangcheck:
- bat-dg2-11: [PASS][1] -> [ABORT][2] ([i915#7913] / [i915#7979])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/bat-dg2-11/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/bat-dg2-11/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@reset:
- bat-rpls-2: NOTRUN -> [ABORT][3] ([i915#4983] / [i915#7461] / [i915#7913] / [i915#8347])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/bat-rpls-2/igt@i915_selftest@[email protected]

* igt@kms_chamelium_hpd@common-hpd-after-suspend:
- fi-glk-j4005: NOTRUN -> [SKIP][4] ([fdo#109271])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/fi-glk-j4005/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@gt_heartbeat:
- fi-apl-guc: [DMESG-FAIL][5] ([i915#5334]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html

* igt@i915_selftest@live@late_gt_pm:
- fi-glk-j4005: [ABORT][7] ([i915#6217]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/fi-glk-j4005/igt@i915_selftest@live@late_gt_pm.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/fi-glk-j4005/igt@i915_selftest@live@late_gt_pm.html

* igt@i915_selftest@live@mman:
- bat-rpls-2: [TIMEOUT][9] ([i915#6794] / [i915#7392]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/bat-rpls-2/igt@i915_selftest@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/bat-rpls-2/igt@i915_selftest@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#4423]: https://gitlab.freedesktop.org/drm/intel/issues/4423
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#6217]: https://gitlab.freedesktop.org/drm/intel/issues/6217
[i915#6794]: https://gitlab.freedesktop.org/drm/intel/issues/6794
[i915#7392]: https://gitlab.freedesktop.org/drm/intel/issues/7392
[i915#7461]: https://gitlab.freedesktop.org/drm/intel/issues/7461
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7979]: https://gitlab.freedesktop.org/drm/intel/issues/7979
[i915#8347]: https://gitlab.freedesktop.org/drm/intel/issues/8347

Build changes
-------------

* Linux: CI_DRM_13253 -> Patchwork_119098v1

CI-20190529: 20190529
CI_DRM_13253: b5faf562ea160e9dcd7f95b737753ce44134b266 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7322: 2dd77d6d827a308caae49ce3eba759c2bab394ed @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_119098v1: b5faf562ea160e9dcd7f95b737753ce44134b266 @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

bb14476710ee drm/i915/tc: Use standard ternary operator instead of GCC extension

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/index.html

maintainer
#2 lore raw
In reply to Gil Dekel
Quoted 7 lines · Gil Dekel

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.

Thanks for the patch, but no thanks, we'll keep it as it is.

It's acceptable use of GCC extensions in kernel, it's supported by both GCC and Clang, and there are thousands of uses of uses in kernel, and dozens in i915 alone. I don't want to open the door for an influx of patches changing this.

Besides, it's one of the better GCC extensions there is, avoiding the unnecessary duplication and verbosity.

BR,
Jani.

Quoted 23 lines
---
 drivers/gpu/drm/i915/display/intel_display_power_well.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -2
index 916009894d89c..39d0dbad589bf 100644
@@ -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

Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
#3 lore raw

[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/tc: Use standard ternary operator instead of GCC extension

In reply to Gil Dekel
== Series Details ==

== Series Details ==

Series: drm/i915/tc: Use standard ternary operator instead of GCC extension
URL : https://patchwork.freedesktop.org/series/119098/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13253_full -> Patchwork_119098v1_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Participating hosts (7 -> 7)
------------------------------

No changes in participating hosts

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_119098v1_full:

### IGT changes ###

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* igt@gem_ctx_shared@detached-shared-gtt:
- {shard-tglu}: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/shard-tglu-4/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-tglu-5/igt@[email protected]

Known issues
------------

Here are the changes found in Patchwork_119098v1_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_fair@basic-pace-solo@rcs0:
- shard-glk: NOTRUN -> [FAIL][3] ([i915#2842])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-glk2/igt@gem_exec_fair@[email protected]

* igt@gem_lmem_swapping@heavy-multi:
- shard-apl: NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#4613])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-apl2/igt@[email protected]

* igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-dp:
- shard-apl: NOTRUN -> [SKIP][5] ([fdo#109271] / [i915#1937] / [i915#4579])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-apl2/igt@i915_pm_lpsp@[email protected]

* igt@kms_ccs@pipe-b-bad-rotation-90-y_tiled_gen12_mc_ccs:
- shard-glk: NOTRUN -> [SKIP][6] ([fdo#109271] / [i915#3886])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-glk2/igt@kms_ccs@pipe-b-bad-rotation-90-y_tiled_gen12_mc_ccs.html

* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
- shard-glk: [PASS][7] -> [FAIL][8] ([i915#2346]) +1 similar issue
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/shard-glk5/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-glk5/igt@[email protected]

* igt@kms_flip@2x-flip-vs-expired-vblank@ac-hdmi-a1-hdmi-a2:
- shard-glk: [PASS][9] -> [FAIL][10] ([i915#79])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/shard-glk4/igt@kms_flip@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-glk7/igt@kms_flip@[email protected]

* igt@kms_flip_scaled_crc@flip-32bpp-xtile-to-64bpp-xtile-downscaling@pipe-a-valid-mode:
- shard-apl: NOTRUN -> [SKIP][11] ([fdo#109271] / [i915#4579]) +1 similar issue
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-apl2/igt@kms_flip_scaled_crc@flip-32bpp-xtile-to-64bpp-xtile-downscaling@pipe-a-valid-mode.html

* igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs-downscaling@pipe-a-valid-mode:
- shard-glk: NOTRUN -> [SKIP][12] ([fdo#109271] / [i915#4579])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-glk2/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs-downscaling@pipe-a-valid-mode.html

* igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-shrfb-draw-mmap-cpu:
- shard-apl: NOTRUN -> [SKIP][13] ([fdo#109271]) +17 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-apl2/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-shrfb-draw-mmap-cpu.html

* igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-a-vga-1:
- shard-snb: NOTRUN -> [SKIP][14] ([fdo#109271]) +10 similar issues
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-snb2/igt@kms_plane_scaling@[email protected]

* igt@kms_plane_scaling@plane-upscale-with-modifiers-20x20@pipe-b-hdmi-a-1:
- shard-snb: NOTRUN -> [SKIP][15] ([fdo#109271] / [i915#4579]) +5 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-snb1/igt@kms_plane_scaling@[email protected]

* igt@kms_vblank@pipe-d-wait-busy-hang:
- shard-glk: NOTRUN -> [SKIP][16] ([fdo#109271]) +15 similar issues
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-glk2/igt@[email protected]

#### Possible fixes ####

* igt@gem_exec_fair@basic-pace@rcs0:
- {shard-rkl}: [FAIL][17] ([i915#2842]) -> [PASS][18] +2 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/shard-rkl-7/igt@gem_exec_fair@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-rkl-4/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@vecs0:
- shard-glk: [FAIL][19] ([i915#2842]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/shard-glk7/igt@gem_exec_fair@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-glk4/igt@gem_exec_fair@[email protected]

* igt@gem_spin_batch@spin-each:
- shard-apl: [FAIL][21] ([i915#2898]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/shard-apl2/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-apl2/igt@[email protected]

* igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-hdmi-a:
- {shard-dg1}: [SKIP][23] ([i915#1937] / [i915#4579]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/shard-dg1-15/igt@i915_pm_lpsp@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-dg1-19/igt@i915_pm_lpsp@[email protected]

* igt@i915_pm_rpm@dpms-mode-unset-non-lpsp:
- {shard-rkl}: [SKIP][25] ([i915#1397]) -> [PASS][26] +2 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/shard-rkl-7/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-rkl-4/igt@[email protected]

* igt@i915_suspend@basic-s3-without-i915:
- {shard-rkl}: [FAIL][27] ([fdo#103375]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/shard-rkl-3/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-rkl-4/igt@[email protected]

* igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-180-hflip-async-flip:
- {shard-tglu}: [FAIL][29] ([i915#3743]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/shard-tglu-9/igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-180-hflip-async-flip.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-tglu-9/igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-180-hflip-async-flip.html

* igt@kms_cursor_crc@cursor-suspend@pipe-c-dp-1:
- shard-apl: [ABORT][31] ([i915#180]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/shard-apl6/igt@kms_cursor_crc@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-apl2/igt@kms_cursor_crc@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
- shard-apl: [FAIL][33] ([i915#2346]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/shard-apl1/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-apl6/igt@[email protected]

* igt@kms_cursor_legacy@single-move@pipe-b:
- {shard-rkl}: [INCOMPLETE][35] ([i915#8011]) -> [PASS][36] +1 similar issue
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/shard-rkl-7/igt@kms_cursor_legacy@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-rkl-4/igt@kms_cursor_legacy@[email protected]

* igt@kms_fbcon_fbt@fbc-suspend:
- {shard-tglu}: [FAIL][37] ([i915#4767]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/shard-tglu-10/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-tglu-7/igt@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible@a-dp1:
- shard-apl: [FAIL][39] ([i915#79]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13253/shard-apl1/igt@kms_flip@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/shard-apl1/igt@kms_flip@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1937]: https://gitlab.freedesktop.org/drm/intel/issues/1937
[i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2876]: https://gitlab.freedesktop.org/drm/intel/issues/2876
[i915#2898]: https://gitlab.freedesktop.org/drm/intel/issues/2898
[i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3591]: https://gitlab.freedesktop.org/drm/intel/issues/3591
[i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
[i915#3743]: https://gitlab.freedesktop.org/drm/intel/issues/3743
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
[i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
[i915#4391]: https://gitlab.freedesktop.org/drm/intel/issues/4391
[i915#4423]: https://gitlab.freedesktop.org/drm/intel/issues/4423
[i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4767]: https://gitlab.freedesktop.org/drm/intel/issues/4767
[i915#4816]: https://gitlab.freedesktop.org/drm/intel/issues/4816
[i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#5493]: https://gitlab.freedesktop.org/drm/intel/issues/5493
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6268]: https://gitlab.freedesktop.org/drm/intel/issues/6268
[i915#7742]: https://gitlab.freedesktop.org/drm/intel/issues/7742
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
[i915#8011]: https://gitlab.freedesktop.org/drm/intel/issues/8011
[i915#8247]: https://gitlab.freedesktop.org/drm/intel/issues/8247
[i915#8502]: https://gitlab.freedesktop.org/drm/intel/issues/8502

Build changes
-------------

* Linux: CI_DRM_13253 -> Patchwork_119098v1

CI-20190529: 20190529
CI_DRM_13253: b5faf562ea160e9dcd7f95b737753ce44134b266 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7322: 2dd77d6d827a308caae49ce3eba759c2bab394ed @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_119098v1: b5faf562ea160e9dcd7f95b737753ce44134b266 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_119098v1/index.html