powerpc: Report missing features as "skip", not as "expected failure"
PATCH 1/1 powerpc: Report missing features as "skip", not as "expected failure"
Missing CPU or hypervisor features are not a real error, so we should rather report a "skip" here than an "expected failure".
Signed-off-by Thomas Huth <[email protected]>
--- powerpc/spapr_hcall.c | 6 ++++-- powerpc/tm.c | 26 ++++++++++++++++---------- 2 files changed, 20 insertions(+), 12 deletions(-)
powerpc/spapr_hcall.c +4 -2
@@ -118,9 +118,11 @@ static void test_h_random(int argc, char **argv)/* H_RANDOM is optional - so check for sane return values first */ rc =h_random (&rval); -report_xfail ("h-call available" , rc =H_FUNCTION , rc =H_SUCCESS ); -if (rc !=H_SUCCESS ) +if (rc =H_FUNCTION ) { +report_skip ("h-call is not available" );return ; + } +report ("h-call can be used successfully" , rc =H_SUCCESS ); val0 =0ULL ; val1 = ~0ULL ;
powerpc/tm.c +16 -10
@@ -35,15 +35,17 @@ static void cpu_has_tm(int fdtnode, u64 regval __unused, void *ptr) *(int *)ptr +=1 ; } -/* Check whether all CPU nodes have the TM flag */ -static bool all_cpus_have_tm (void ) +/* Check amount of CPUs nodes that have the TM flag */ +static int count_cpus_with_tm (void ) {int ret;int available =0 ; ret =dt_for_each_cpu_node (cpu_has_tm, &available); +if (ret <0 ) +return ret; -return ret =0 && available = nr_cpus; +return available; }static int h_cede (void )
@@ -136,16 +138,18 @@ struct {int main (int argc,char **argv) { -bool all, has_tm; -int i; +bool all; +int i, cpus_with_tm;report_prefix_push ("tm" ); - has_tm =all_cpus_have_tm (); -report_xfail ("TM available in 'ibm,pa-features' property" , - !has_tm, has_tm); -if (!has_tm) -return report_summary (); + cpus_with_tm =count_cpus_with_tm (); +if (cpus_with_tm =0 ) { +report_skip ("TM is not available" ); + goto done; + } +report ("TM available in all 'ibm,pa-features' properties" , + cpus_with_tm = nr_cpus); all = argc =1 || !strcmp (argv[1 ],"all" );
@@ -157,5 +161,7 @@ int main(int argc, char **argv) } } +done: +report_prefix_pop ();return report_summary (); }
Signature · 1 line
1.8.3.1