Skip to contentSkip to conversation

drm/i915/dp: silence a static checker warning

PATCH In review Dan Carpenter 4 participants 9 messages May 3, 2018 – May 4, 2018

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

PATCH 1/1 drm/i915/dp: silence a static checker warning

Smatch warns that "n_entries" isn't always set. It would trigger a some WARN_ON()s on that path so presumably it can't happen but it's simple enough to initialize it to zero just to silence the warning.

drivers/gpu/drm/i915/intel_ddi.c +1 -1
index 8225d223f452..f4951ae33ac2 100644
@@ -2062,7 +2062,7 @@ u8 intel_ddi_dp_voltage_max(struct intel_encoder *encoder)
 {
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 	enum port port = encoder->port;
-	int n_entries;
+	int n_entries = 0;
 
 	if (IS_ICELAKE(dev_priv)) {
 		if (port = PORT_A || port = PORT_B)
#1 lore raw

✓ Fi.CI.BAT: success for drm/i915/dp: silence a static checker warning

== Series Details ==

== Series Details ==

Series: drm/i915/dp: silence a static checker warning
URL : https://patchwork.freedesktop.org/series/42630/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4131 -> Patchwork_8894 =

== Summary - WARNING ==

Minor unknown changes coming with Patchwork_8894 need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_8894, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/42630/revisions/1/mbox/

== Possible new issues ==

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

=== IGT changes ===

    ==== Warnings ====

    igt@gem_exec_gttfill@basic:
      fi-pnv-d510:        PASS -> SKIP

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_suspend@basic-s4-devices:
      fi-ivb-3520m:       PASS -> DMESG-WARN (fdo#106084)

    
    ==== Possible fixes ====

    igt@drv_module_reload@basic-reload:
      fi-bsw-n3050:       DMESG-FAIL -> PASS

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-skl-6770hq:      FAIL (fdo#100368) -> PASS

    igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
      fi-skl-6770hq:      FAIL (fdo#103481) -> PASS +1

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
fdo#106084 https://bugs.freedesktop.org/show_bug.cgi?id=106084

== Participating hosts (39 -> 37) ==

Additional (1): fi-byt-j1900
Missing (3): fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq

== Build changes ==

* Linux: CI_DRM_4131 -> Patchwork_8894

CI_DRM_4131: 46d3a67e7a5611ef8af00cb7adebf03817856645 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4459: 1b8977e08031253d61b4641bc21e5c7a990d4a4f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8894: c944888c40414d15d187e6ebdeda7829efeef881 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4459: f74d92e704849610364b4474a2c67ea2008c14e0 @ git://anongit.freedesktop.org/piglit

== Linux commits ==

c944888c4041 drm/i915/dp: silence a static checker warning

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8894/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✗ Fi.CI.IGT: failure for drm/i915/dp: silence a static checker warning

In reply to Dan Carpenter
== Series Details ==

== Series Details ==

Series: drm/i915/dp: silence a static checker warning
URL : https://patchwork.freedesktop.org/series/42630/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4131_full -> Patchwork_8894_full =

== Summary - FAILURE ==

Serious unknown changes coming with Patchwork_8894_full absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_8894_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/42630/revisions/1/mbox/

== Possible new issues ==

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

=== IGT changes ===

    ==== Possible regressions ====

    igt@kms_flip@busy-flip-interruptible:
      shard-apl:          PASS -> FAIL

    igt@kms_plane@plane-position-covered-pipe-a-planes:
      shard-kbl:          PASS -> FAIL

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

    igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
      shard-kbl:          PASS -> DMESG-WARN (fdo#105602, fdo#103313, fdo#103558)

    igt@kms_frontbuffer_tracking@fbc-farfromfence:
      shard-kbl:          PASS -> DMESG-WARN (fdo#105602, fdo#103558) +12

    igt@kms_setmode@basic:
      shard-glk:          PASS -> FAIL (fdo#99912)

    igt@kms_setmode@basic-clone-single-crtc:
      shard-apl:          PASS -> INCOMPLETE (fdo#103927)

    
    ==== Possible fixes ====

    igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
      shard-hsw:          FAIL (fdo#105767) -> PASS

    igt@kms_flip@absolute-wf_vblank-interruptible:
      shard-glk:          FAIL (fdo#106087) -> PASS

    igt@kms_flip@basic-flip-vs-wf_vblank:
      shard-hsw:          FAIL (fdo#103928) -> PASS

    igt@kms_flip@plain-flip-fb-recreate:
      shard-hsw:          FAIL (fdo#100368) -> PASS

    igt@kms_flip@wf_vblank-ts-check-interruptible:
      shard-glk:          FAIL (fdo#100368) -> PASS +1

    igt@kms_rotation_crc@primary-rotation-180:
      shard-hsw:          FAIL (fdo#103925) -> PASS

    igt@kms_vblank@pipe-b-ts-continuation-suspend:
      shard-kbl:          INCOMPLETE (fdo#103665) -> PASS

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103313 https://bugs.freedesktop.org/show_bug.cgi?id=103313
fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
fdo#105767 https://bugs.freedesktop.org/show_bug.cgi?id=105767
fdo#106087 https://bugs.freedesktop.org/show_bug.cgi?id=106087
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

== Participating hosts (6 -> 6) ==

No changes in participating hosts

== Build changes ==

* Linux: CI_DRM_4131 -> Patchwork_8894

CI_DRM_4131: 46d3a67e7a5611ef8af00cb7adebf03817856645 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4459: 1b8977e08031253d61b4641bc21e5c7a990d4a4f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8894: c944888c40414d15d187e6ebdeda7829efeef881 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4459: f74d92e704849610364b4474a2c67ea2008c14e0 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8894/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Dan Carpenter
Quoted 3 lines · Dan Carpenter

Smatch warns that "n_entries" isn't always set. It would trigger a some WARN_ON()s on that path so presumably it can't happen but it's simple enough to initialize it to zero just to silence the warning.

I usually would just ask if it would be possible to dispositioning as false positive or intentional on the tool, but it looks better indeed...

so, why not?!

Quoted 2 lines
Quoted 14 lines
drivers/gpu/drm/i915/intel_ddi.c +1 -1
index 8225d223f452..f4951ae33ac2 100644
@@ -2062,7 +2062,7 @@ u8 intel_ddi_dp_voltage_max(struct intel_encoder *encoder)
 {
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 	enum port port = encoder->port;
-	int n_entries;
+	int n_entries = 0;
 
 	if (IS_ICELAKE(dev_priv)) {
 		if (port = PORT_A || port = PORT_B)
#5 lore raw

✓ Fi.CI.BAT: success for drm/i915/dp: silence a static checker warning

In reply to Dan Carpenter
== Series Details ==

== Series Details ==

Series: drm/i915/dp: silence a static checker warning
URL : https://patchwork.freedesktop.org/series/42630/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4134 -> Patchwork_8900 =

== Summary - SUCCESS ==

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/42630/revisions/1/mbox/

== Known issues ==

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

=== IGT changes ===

    ==== Possible fixes ====

    igt@drv_module_reload@basic-no-display:
      fi-bsw-n3050:       DMESG-FAIL (fdo#106373) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-ivb-3520m:       DMESG-WARN (fdo#106084) -> PASS

    
    ==== Warnings ====

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      fi-cnl-y3:          DMESG-WARN (fdo#104951) -> DMESG-FAIL (fdo#103191)

fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#104951 https://bugs.freedesktop.org/show_bug.cgi?id=104951
fdo#106084 https://bugs.freedesktop.org/show_bug.cgi?id=106084
fdo#106373 https://bugs.freedesktop.org/show_bug.cgi?id=106373

== Participating hosts (40 -> 37) ==

Missing (3): fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq

== Build changes ==

* Linux: CI_DRM_4134 -> Patchwork_8900

CI_DRM_4134: 3fc6b5905d2bac264ced33d06f0cb2245c62b83f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4460: f772d9a910130b3aec8efa4f09ed723618fae656 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8900: 4dcdcac5675cbf30f6907f9b1f6a78914c9e46b5 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4460: f74d92e704849610364b4474a2c67ea2008c14e0 @ git://anongit.freedesktop.org/piglit

== Linux commits ==

4dcdcac5675c drm/i915/dp: silence a static checker warning

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8900/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

✗ Fi.CI.IGT: failure for drm/i915/dp: silence a static checker warning

In reply to Dan Carpenter
== Series Details ==

== Series Details ==

Series: drm/i915/dp: silence a static checker warning
URL : https://patchwork.freedesktop.org/series/42630/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4134_full -> Patchwork_8900_full =

== Summary - FAILURE ==

Serious unknown changes coming with Patchwork_8900_full absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_8900_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/42630/revisions/1/mbox/

== Possible new issues ==

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

=== IGT changes ===

    ==== Possible regressions ====

    igt@gem_exec_await@wide-contexts:
      shard-apl:          PASS -> FAIL

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

    igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
      shard-hsw:          PASS -> FAIL (fdo#102887)

    igt@kms_flip@absolute-wf_vblank:
      shard-kbl:          PASS -> DMESG-WARN (fdo#103558, fdo#105602) +20

    igt@kms_flip@dpms-vs-vblank-race:
      shard-hsw:          PASS -> FAIL (fdo#103060)

    igt@kms_flip@flip-vs-wf_vblank-interruptible:
      shard-apl:          PASS -> FAIL (fdo#100368)

    igt@kms_flip@plain-flip-fb-recreate:
      shard-hsw:          PASS -> FAIL (fdo#103928)

    igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
      shard-apl:          PASS -> INCOMPLETE (fdo#103927)

    igt@kms_rotation_crc@primary-rotation-180:
      shard-apl:          PASS -> FAIL (fdo#103925)

    
    ==== Possible fixes ====

    igt@kms_flip@2x-modeset-vs-vblank-race:
      shard-hsw:          FAIL (fdo#103060) -> PASS

    igt@kms_flip@flip-vs-expired-vblank:
      shard-hsw:          FAIL (fdo#102887) -> PASS

    igt@kms_flip@flip-vs-expired-vblank-interruptible:
      shard-apl:          FAIL (fdo#102887, fdo#105363) -> PASS

    igt@kms_setmode@basic:
      shard-kbl:          FAIL (fdo#99912) -> PASS

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

== Participating hosts (6 -> 6) ==

No changes in participating hosts

== Build changes ==

* Linux: CI_DRM_4134 -> Patchwork_8900

CI_DRM_4134: 3fc6b5905d2bac264ced33d06f0cb2245c62b83f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4460: f772d9a910130b3aec8efa4f09ed723618fae656 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8900: 4dcdcac5675cbf30f6907f9b1f6a78914c9e46b5 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4460: f74d92e704849610364b4474a2c67ea2008c14e0 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8900/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
In reply to Rodrigo Vivi

Quoting Rodrigo Vivi (2018-05-03 17:40:00)

Quoted 8 lines · Dan Carpenter
Quoted 3 lines

Smatch warns that "n_entries" isn't always set. It would trigger a some WARN_ON()s on that path so presumably it can't happen but it's simple enough to initialize it to zero just to silence the warning.

I usually would just ask if it would be possible to dispositioning as false positive or intentional on the tool, but it looks better indeed...

It doesn't appear to be a false positive.

intel_ddi_dp_voltage_max
-> icl_get_combo_buf_trans()
default:

		MISSING_CASE();
		return NULL; /* *n_entries unset */

With

@@ -888,6 +888,7 @@ icl_get_combo_buf_trans(struct drm_i915_private *dev_priv, enum port port,

                        *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_edp_1_05V);
                        return icl_combo_phy_ddi_translations_edp_1_05V;
                default:
+                       *n_entries = 0;
                        MISSING_CASE(voltage);
                        return NULL;
                }
@@ -903,6 +904,7 @@ icl_get_combo_buf_trans(struct drm_i915_private *dev_priv, enum port port,
                        *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_dp_hdmi_1_05V);
                        return icl_combo_phy_ddi_translations_dp_hdmi_1_05V;
                default:
+                       *n_entries = 0;
                        MISSING_CASE(voltage);
                        return NULL;
                }

smatch is reassured that all paths then initialise n_entries. -Chris

#7 lore raw

PATCH 1/1 drm/i915/dp: Silence static checkers for n_entries

In reply to Dan Carpenter

Smatch warns that n_entries isn't always set, so copy'n'paste the common response used in the other setup paths to silence gcc. The advantage of fixing it in situ (rather than use a zero initialiser) is that the analysers are quite capable of then spotting the absence.

---
 drivers/gpu/drm/i915/intel_ddi.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_ddi.c +2 -0
index 8225d223f452..31f781bb73ca 100644
@@ -888,6 +888,7 @@ icl_get_combo_buf_trans(struct drm_i915_private *dev_priv, enum port port,
 			*n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_edp_1_05V);
 			return icl_combo_phy_ddi_translations_edp_1_05V;
 		default:
+			*n_entries = 1; /* shut up gcc */
 			MISSING_CASE(voltage);
 			return NULL;
 		}
@@ -903,6 +904,7 @@ icl_get_combo_buf_trans(struct drm_i915_private *dev_priv, enum port port,
 			*n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_dp_hdmi_1_05V);
 			return icl_combo_phy_ddi_translations_dp_hdmi_1_05V;
 		default:
+			*n_entries = 1; /* shut up gcc */
 			MISSING_CASE(voltage);
 			return NULL;
 		}
Signature · 6 lines
2.17.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

✗ Fi.CI.BAT: failure for drm/i915/dp: silence a static checker warning (rev2)

In reply to Dan Carpenter
== Series Details ==

== Series Details ==

Series: drm/i915/dp: silence a static checker warning (rev2)
URL : https://patchwork.freedesktop.org/series/42630/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4146 -> Patchwork_8911 =

== Summary - FAILURE ==

Serious unknown changes coming with Patchwork_8911 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_8911, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/42630/revisions/2/mbox/

== Possible new issues ==

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

=== IGT changes ===

    ==== Possible regressions ====

    igt@drv_module_reload@basic-reload:
      fi-ilk-650:         PASS -> DMESG-WARN

    
    ==== Warnings ====

    igt@gem_exec_gttfill@basic:
      fi-pnv-d510:        PASS -> SKIP

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-snb-2520m:       NOTRUN -> INCOMPLETE (fdo#103713)

    
    ==== Possible fixes ====

    igt@debugfs_test@read_all_entries:
      fi-snb-2520m:       INCOMPLETE (fdo#103713) -> PASS

    igt@gem_exec_suspend@basic-s4-devices:
      fi-skl-guc:         FAIL (fdo#105900, fdo#104699) -> PASS +1

    igt@kms_frontbuffer_tracking@basic:
      fi-hsw-4200u:       DMESG-FAIL (fdo#102614) -> PASS

fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#104699 https://bugs.freedesktop.org/show_bug.cgi?id=104699
fdo#105900 https://bugs.freedesktop.org/show_bug.cgi?id=105900

== Participating hosts (39 -> 37) ==

Additional (1): fi-skl-gvtdvm
Missing (3): fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq

== Build changes ==

* Linux: CI_DRM_4146 -> Patchwork_8911

CI_DRM_4146: be068d4cb8a8b4709af83ffa993d8fc8889f0230 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4461: f772d9a910130b3aec8efa4f09ed723618fae656 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8911: 8e8ce932f8f43a77e10ab48ce06173e8bf100ea4 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4461: 55207ea5154dfaa6d2c128124c50e3be4f9b6440 @ git://anongit.freedesktop.org/piglit

== Linux commits ==

8e8ce932f8f4 drm/i915/dp: Silence static checkers for n_entries

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8911/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx