diff mbox series

[RESEND] drm/i915/syncmap: squelch a sparse warning

Message ID 20231129173506.1194437-1-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series [RESEND] drm/i915/syncmap: squelch a sparse warning | expand

Commit Message

Jani Nikula Nov. 29, 2023, 5:35 p.m. UTC
The code is fine, really, but tweak it to get rid of the sparse warning:

drivers/gpu/drm/i915/selftests/i915_syncmap.c:80:54: warning: dubious: x | !y

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/selftests/i915_syncmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vivi, Rodrigo Nov. 29, 2023, 7:21 p.m. UTC | #1
On Wed, Nov 29, 2023 at 07:35:06PM +0200, Jani Nikula wrote:
> The code is fine, really, but tweak it to get rid of the sparse warning:
> 
> drivers/gpu/drm/i915/selftests/i915_syncmap.c:80:54: warning: dubious: x | !y
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

I always disliked the '!!' magic anyway,

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/selftests/i915_syncmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/selftests/i915_syncmap.c b/drivers/gpu/drm/i915/selftests/i915_syncmap.c
> index 47f4ae18a1ef..88fa845e9f4a 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_syncmap.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_syncmap.c
> @@ -77,7 +77,7 @@ __sync_print(struct i915_syncmap *p,
>  		for_each_set_bit(i, (unsigned long *)&p->bitmap, KSYNCMAP) {
>  			buf = __sync_print(__sync_child(p)[i], buf, sz,
>  					   depth + 1,
> -					   last << 1 | !!(p->bitmap >> (i + 1)),
> +					   last << 1 | ((p->bitmap >> (i + 1)) ? 1 : 0),
>  					   i);
>  		}
>  	}
> -- 
> 2.39.2
>
Jani Nikula Nov. 30, 2023, 8:06 a.m. UTC | #2
On Thu, 30 Nov 2023, Patchwork <patchwork@emeril.freedesktop.org> wrote:
> == Series Details ==
>
> Series: drm/i915/syncmap: squelch a sparse warning (rev2)
> URL   : https://patchwork.freedesktop.org/series/117802/
> State : failure
>
> == Summary ==
>
> CI Bug Log - changes from CI_DRM_13951 -> Patchwork_117802v2
> ====================================================
>
> Summary
> -------
>
>   **FAILURE**
>
>   Serious unknown changes coming with Patchwork_117802v2 absolutely need to be
>   verified manually.
>   
>   If you think the reported changes have nothing to do with the changes
>   introduced in Patchwork_117802v2, please notify your bug team (I915-ci-infra@lists.freedesktop.org) to allow them
>   to document this new failure mode, which will reduce false positives in CI.
>
>   External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117802v2/index.html
>
> Participating hosts (36 -> 35)
> ------------------------------
>
>   Additional (1): bat-kbl-2 
>   Missing    (2): fi-snb-2520m bat-dg1-5 
>
> Possible new issues
> -------------------
>
>   Here are the unknown changes that may have been introduced in Patchwork_117802v2:
>
> ### IGT changes ###
>
> #### Possible regressions ####
>
>   * igt@i915_pm_rpm@module-reload:
>     - bat-atsm-1:         [PASS][1] -> [SKIP][2]
>    [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13951/bat-atsm-1/igt@i915_pm_rpm@module-reload.html
>    [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117802v2/bat-atsm-1/igt@i915_pm_rpm@module-reload.html

Unrelated, please re-report.

BR,
Jani.

>
>   
> Known issues
> ------------
>
>   Here are the changes found in Patchwork_117802v2 that come from known issues:
>
> ### IGT changes ###
>
> #### Issues hit ####
>
>   * igt@fbdev@info:
>     - bat-kbl-2:          NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#1849])
>    [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117802v2/bat-kbl-2/igt@fbdev@info.html
>
>   * igt@gem_lmem_swapping@parallel-random-engines:
>     - bat-kbl-2:          NOTRUN -> [SKIP][4] ([fdo#109271]) +20 other tests skip
>    [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117802v2/bat-kbl-2/igt@gem_lmem_swapping@parallel-random-engines.html
>
>   * igt@i915_selftest@live@gt_heartbeat:
>     - fi-kbl-guc:         [PASS][5] -> [DMESG-FAIL][6] ([i915#5334] / [i915#7872])
>    [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13951/fi-kbl-guc/igt@i915_selftest@live@gt_heartbeat.html
>    [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117802v2/fi-kbl-guc/igt@i915_selftest@live@gt_heartbeat.html
>
>   * igt@i915_selftest@live@workarounds:
>     - bat-dg2-11:         [PASS][7] -> [DMESG-FAIL][8] ([i915#9500])
>    [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13951/bat-dg2-11/igt@i915_selftest@live@workarounds.html
>    [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117802v2/bat-dg2-11/igt@i915_selftest@live@workarounds.html
>
>   * igt@kms_pipe_crc_basic@nonblocking-crc:
>     - bat-dg2-11:         NOTRUN -> [SKIP][9] ([i915#1845] / [i915#9197])
>    [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117802v2/bat-dg2-11/igt@kms_pipe_crc_basic@nonblocking-crc.html
>
>   * igt@kms_pipe_crc_basic@read-crc-frame-sequence:
>     - bat-kbl-2:          NOTRUN -> [SKIP][10] ([fdo#109271] / [i915#1845]) +14 other tests skip
>    [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117802v2/bat-kbl-2/igt@kms_pipe_crc_basic@read-crc-frame-sequence.html
>
>   
> #### Possible fixes ####
>
>   * igt@i915_selftest@live@gt_heartbeat:
>     - fi-apl-guc:         [DMESG-FAIL][11] ([i915#5334]) -> [PASS][12]
>    [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13951/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
>    [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117802v2/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
>
>   * igt@kms_hdmi_inject@inject-audio:
>     - fi-kbl-guc:         [FAIL][13] ([IGT#3]) -> [PASS][14]
>    [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13951/fi-kbl-guc/igt@kms_hdmi_inject@inject-audio.html
>    [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117802v2/fi-kbl-guc/igt@kms_hdmi_inject@inject-audio.html
>
>   * igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1:
>     - bat-rplp-1:         [ABORT][15] ([i915#8668]) -> [PASS][16]
>    [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13951/bat-rplp-1/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1.html
>    [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117802v2/bat-rplp-1/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1.html
>
>   
>   {name}: This element is suppressed. This means it is ignored when computing
>           the status of the difference (SUCCESS, WARNING, or FAILURE).
>
>   [IGT#3]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/3
>   [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
>   [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
>   [i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
>   [i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
>   [i915#7872]: https://gitlab.freedesktop.org/drm/intel/issues/7872
>   [i915#8668]: https://gitlab.freedesktop.org/drm/intel/issues/8668
>   [i915#9197]: https://gitlab.freedesktop.org/drm/intel/issues/9197
>   [i915#9500]: https://gitlab.freedesktop.org/drm/intel/issues/9500
>
>
> Build changes
> -------------
>
>   * Linux: CI_DRM_13951 -> Patchwork_117802v2
>
>   CI-20190529: 20190529
>   CI_DRM_13951: 7bd342323d5bd405b02fd21cd78f157f363278ac @ git://anongit.freedesktop.org/gfx-ci/linux
>   IGT_7610: 7610
>   Patchwork_117802v2: 7bd342323d5bd405b02fd21cd78f157f363278ac @ git://anongit.freedesktop.org/gfx-ci/linux
>
>
> ### Linux commits
>
> a3a672d1394c drm/i915/syncmap: squelch a sparse warning
>
> == Logs ==
>
> For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117802v2/index.html
Jani Nikula Dec. 4, 2023, 10:12 a.m. UTC | #3
On Wed, 29 Nov 2023, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> On Wed, Nov 29, 2023 at 07:35:06PM +0200, Jani Nikula wrote:
>> The code is fine, really, but tweak it to get rid of the sparse warning:
>> 
>> drivers/gpu/drm/i915/selftests/i915_syncmap.c:80:54: warning: dubious: x | !y
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> I always disliked the '!!' magic anyway,
>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

Thanks, pushed.


>
>> ---
>>  drivers/gpu/drm/i915/selftests/i915_syncmap.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/selftests/i915_syncmap.c b/drivers/gpu/drm/i915/selftests/i915_syncmap.c
>> index 47f4ae18a1ef..88fa845e9f4a 100644
>> --- a/drivers/gpu/drm/i915/selftests/i915_syncmap.c
>> +++ b/drivers/gpu/drm/i915/selftests/i915_syncmap.c
>> @@ -77,7 +77,7 @@ __sync_print(struct i915_syncmap *p,
>>  		for_each_set_bit(i, (unsigned long *)&p->bitmap, KSYNCMAP) {
>>  			buf = __sync_print(__sync_child(p)[i], buf, sz,
>>  					   depth + 1,
>> -					   last << 1 | !!(p->bitmap >> (i + 1)),
>> +					   last << 1 | ((p->bitmap >> (i + 1)) ? 1 : 0),
>>  					   i);
>>  		}
>>  	}
>> -- 
>> 2.39.2
>>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/selftests/i915_syncmap.c b/drivers/gpu/drm/i915/selftests/i915_syncmap.c
index 47f4ae18a1ef..88fa845e9f4a 100644
--- a/drivers/gpu/drm/i915/selftests/i915_syncmap.c
+++ b/drivers/gpu/drm/i915/selftests/i915_syncmap.c
@@ -77,7 +77,7 @@  __sync_print(struct i915_syncmap *p,
 		for_each_set_bit(i, (unsigned long *)&p->bitmap, KSYNCMAP) {
 			buf = __sync_print(__sync_child(p)[i], buf, sz,
 					   depth + 1,
-					   last << 1 | !!(p->bitmap >> (i + 1)),
+					   last << 1 | ((p->bitmap >> (i + 1)) ? 1 : 0),
 					   i);
 		}
 	}