Skip to contentSkip to conversation

selftests/arm64: signal: fix inverted feature mask in diagnostics

PATCH In review Long Wei 2 participants 2 messages Nov 14 – Nov 15

Subsystems (2)
lore
Share & tools
lore

Long Wei

author
#0 lore raw

PATCH 1/1 selftests/arm64: signal: fix inverted feature mask in diagnostics

When a testcase is skipped because an incompatible CPU feature is present, test_init() reports the feature set with:

feats_incompatible & ~feats_supported

That is the set of incompatible features which are *not* supported, i.e. always empty, instead of the incompatible features which actually triggered the skip. As a result the diagnostic prints an empty list and gives no hint about why the test was skipped.

Use the supported set so the offending feature is reported:

feats_incompatible & feats_supported

Fixes 32de73e89099 ("kselftest/arm64: signal: Allow tests to be incompatible with features")
---
 tools/testing/selftests/arm64/signal/test_signals_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/arm64/signal/test_signals_utils.c +1 -1
index 4b12dbd7669d..16036e06d6c1 100644
@@ -365,7 +365,7 @@ int test_init(struct tdescr *td)
 				fprintf(stderr,
 					"Incompatible Features: [%s] supported\n",
 					feats_to_string(td->feats_incompatible &
-							~td->feats_supported));
+							td->feats_supported));
 
 
 			td->result = KSFT_SKIP;
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Long Wei

When a testcase is skipped because an incompatible CPU feature is present, test_init() reports the feature set with:

feats_incompatible & ~feats_supported

That is the set of incompatible features which are *not* supported, i.e. always empty, instead of the incompatible features which actually triggered the skip. As a result the diagnostic prints an empty list and gives no hint about why the test was skipped.

Looks like a cut'n'paste error.