All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] drm/i915/kunit: DP link: add fallback tests
@ 2026-08-19  7:14 Dan Carpenter
  2026-08-19  7:33 ` Michał Grzelak
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2026-08-19  7:14 UTC (permalink / raw)
  To: Imre Deak; +Cc: intel-xe

Hello Imre Deak,

Commit 4fee95d4f887 ("drm/i915/kunit: DP link: add fallback tests")
from Jul 1, 2026 (linux-next), leads to the following Smatch static
checker warning:

	drivers/gpu/drm/i915/display/tests/intel_dp_link_test.c:1223 get_fallback_config()
	warn: ignoring unreachable code.

drivers/gpu/drm/i915/display/tests/intel_dp_link_test.c
    1210 static bool get_fallback_config(const struct test_config_table *expected_table,
    1211                                 enum intel_output_type output_type,
    1212                                 const struct intel_dp_link_config *target_config,
    1213                                 struct intel_dp_link_config *fallback_config)
    1214 {
    1215         struct kunit *test = expected_table->test;
    1216         const struct link_config_set *config_set =
    1217                 get_fallback_configs_for_output_type(test, output_type);
    1218         int i;
    1219 
    1220         i = lookup_config(config_set, target_config);
    1221         KUNIT_ASSERT_GE(test, i, 0);
    1222 
--> 1223         for (i--; i >= 0; i--) {
    1224                 const struct intel_dp_link_config *config =
    1225                         &config_set->entries[i];
    1226 
    1227                 assert_config_is_supported(expected_table, config);
    1228                 *fallback_config = *config;
    1229 
    1230                 return true;

This return statement means this for loop doesn't loop.

    1231         }
    1232 
    1233         return false;
    1234 }

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] drm/i915/kunit: DP link: add fallback tests
  2026-08-19  7:14 [bug report] drm/i915/kunit: DP link: add fallback tests Dan Carpenter
@ 2026-08-19  7:33 ` Michał Grzelak
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Grzelak @ 2026-08-19  7:33 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Imre Deak, intel-xe, Jonathan Cavitt

[-- Attachment #1: Type: text/plain, Size: 1926 bytes --]

Hi Dan,

On Wed, 19 Aug 2026, Dan Carpenter wrote:
> Hello Imre Deak,
>
> Commit 4fee95d4f887 ("drm/i915/kunit: DP link: add fallback tests")
> from Jul 1, 2026 (linux-next), leads to the following Smatch static
> checker warning:
>
> 	drivers/gpu/drm/i915/display/tests/intel_dp_link_test.c:1223 get_fallback_config()
> 	warn: ignoring unreachable code.
>
> drivers/gpu/drm/i915/display/tests/intel_dp_link_test.c
>    1210 static bool get_fallback_config(const struct test_config_table *expected_table,
>    1211                                 enum intel_output_type output_type,
>    1212                                 const struct intel_dp_link_config *target_config,
>    1213                                 struct intel_dp_link_config *fallback_config)
>    1214 {
>    1215         struct kunit *test = expected_table->test;
>    1216         const struct link_config_set *config_set =
>    1217                 get_fallback_configs_for_output_type(test, output_type);
>    1218         int i;
>    1219
>    1220         i = lookup_config(config_set, target_config);
>    1221         KUNIT_ASSERT_GE(test, i, 0);
>    1222
> --> 1223         for (i--; i >= 0; i--) {
>    1224                 const struct intel_dp_link_config *config =
>    1225                         &config_set->entries[i];
>    1226
>    1227                 assert_config_is_supported(expected_table, config);
>    1228                 *fallback_config = *config;
>    1229
>    1230                 return true;
>
> This return statement means this for loop doesn't loop.

Same applies for get_target_config(); there is a fix under review for
both [1].

BR,
Michał

[1] https://lore.kernel.org/intel-gfx/20260812141300.184053-1-jonathan.cavitt@intel.com

>
>    1231         }
>    1232
>    1233         return false;
>    1234 }
>
> This email is a free service from the Smatch-CI project [smatch.sf.net].
>
> regards,
> dan carpenter
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-19  7:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19  7:14 [bug report] drm/i915/kunit: DP link: add fallback tests Dan Carpenter
2026-08-19  7:33 ` Michał Grzelak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.