All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib: Fix parse of supported suspend states
@ 2020-09-10 21:09 José Roberto de Souza
  2020-09-10 21:55 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: José Roberto de Souza @ 2020-09-10 21:09 UTC (permalink / raw)
  To: igt-dev; +Cc: Lucas De Marchi

If /sys/power/state some day has a new state that is not in
suspend_state_name it would cause "1 << SUSPEND_STATE_NUM" bit to be
set.

Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 lib/igt_aux.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index fba349334..47074c32b 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -816,9 +816,7 @@ static uint32_t get_supported_suspend_states(int power_dir)
 		for (state = SUSPEND_STATE_FREEZE; state < SUSPEND_STATE_NUM;
 		     state++)
 			if (strcmp(state_name, suspend_state_name[state]) == 0)
-				break;
-		igt_assert(state < SUSPEND_STATE_NUM);
-		state_mask |= 1 << state;
+				state_mask |= 1 << state;
 	}
 
 	free(states);
-- 
2.28.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2020-09-11  1:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 21:09 [igt-dev] [PATCH i-g-t] lib: Fix parse of supported suspend states José Roberto de Souza
2020-09-10 21:55 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-09-10 22:57 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-09-10 23:29 ` [igt-dev] ✓ Fi.CI.BAT: success for lib: Fix parse of supported suspend states (rev2) Patchwork
2020-09-11  1:24 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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.