[igt-dev] [PATCH i-g-t 2/3] runner: Refactor abort-checking to a helper function
Petri Latvala
petri.latvala at intel.com
Thu Jan 26 10:53:37 UTC 2023
Abort-condition checking at runtime will later use the helper
differently.
Signed-off-by: Petri Latvala <petri.latvala at intel.com>
Cc: Arkadiusz Hiler <arek at hiler.eu>
Cc: Kamil Konieczny <kamil.konieczny at linux.intel.com>
---
runner/executor.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/runner/executor.c b/runner/executor.c
index 9d3623b4..5b4e84d1 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -348,21 +348,21 @@ static const struct {
{ 0, 0 },
};
-static char *need_to_abort(const struct settings* settings)
+static char *_need_to_abort(int abort_mask, int log_level)
{
typeof(*abort_handlers) *it;
for (it = abort_handlers; it->condition; it++) {
char *abort;
- if (!(settings->abort_mask & it->condition))
+ if (!(abort_mask & it->condition))
continue;
abort = it->handler();
if (!abort)
continue;
- if (settings->log_level >= LOG_LEVEL_NORMAL)
+ if (log_level >= LOG_LEVEL_NORMAL)
errf("Aborting: %s\n", abort);
return abort;
@@ -371,6 +371,11 @@ static char *need_to_abort(const struct settings* settings)
return NULL;
}
+static char *need_to_abort(const struct settings *settings)
+{
+ return _need_to_abort(settings->abort_mask, settings->log_level);
+}
+
static void prune_subtest(struct job_list_entry *entry, const char *subtest)
{
char *excl;
--
2.30.2
More information about the igt-dev
mailing list