Looks OK as far as I can see, except that I wonder why you check for being root: since there is no restriction by the kernel on which processes can use this system call.  A process can't do anything to any other process using this system call, so there's no reason to restrict it. Also you might like to call it "endian_switch()" rather than just "switch()". Paul Mackerras <paulus@samba.org>.
diff --git a/testcases/kernel/syscalls/switch/switch01.c b/testcases/kernel/syscalls/switch/switch01.c
index 3f1c7e1..ad2da7d 100644
--- a/testcases/kernel/syscalls/switch/switch01.c
+++ b/testcases/kernel/syscalls/switch/switch01.c
@@ -66,11 +66,6 @@
         /* capture signals */
         tst_sig(FORK, DEF_HANDLER, cleanup);
 
-        /* Check whether we are root*/
-        if (geteuid() != 0) {
-                tst_brkm(TBROK, tst_exit, "Test must be run as root");
-        }
-
         /* Pause if that option was specified */
         TEST_PAUSE;
 
@@ -127,7 +122,7 @@
                 tst_resm(TFAIL, "Got SIGILL - test failed");
                 tst_exit();
 	}
-        tst_resm(TPASS, "switch() syscall tests passed");
+        tst_resm(TPASS, "endian_switch() syscall tests passed");
         tst_exit();
 }