selftests/powerpc: Fix error handling in FPU/VMX preemption tests
[platform/kernel/linux-rpi.git] / tools / testing / selftests / powerpc / math / fpu_preempt.c
index 5235bdc..3e5b566 100644 (file)
@@ -37,19 +37,20 @@ __thread double darray[] = {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0,
 int threads_starting;
 int running;
 
-extern void preempt_fpu(double *darray, int *threads_starting, int *running);
+extern int preempt_fpu(double *darray, int *threads_starting, int *running);
 
 void *preempt_fpu_c(void *p)
 {
+       long rc;
        int i;
+
        srand(pthread_self());
        for (i = 0; i < 21; i++)
                darray[i] = rand();
 
-       /* Test failed if it ever returns */
-       preempt_fpu(darray, &threads_starting, &running);
+       rc = preempt_fpu(darray, &threads_starting, &running);
 
-       return p;
+       return (void *)rc;
 }
 
 int test_preempt_fpu(void)