OSDN Git Service

selftests/bpf: Avoid useless void *-casts
authorBjörn Töpel <bjorn.topel@intel.com>
Fri, 22 Jan 2021 15:47:25 +0000 (16:47 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 25 Jan 2021 23:05:02 +0000 (00:05 +0100)
There is no need to cast to void * when the argument is void *. Avoid
cluttering of code.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210122154725.22140-13-bjorn.topel@gmail.com
tools/testing/selftests/bpf/xdpxceiver.c

index a64e2a9..99ea6cf 100644 (file)
@@ -416,7 +416,7 @@ static int validate_interfaces(void)
                                exit_with_error(errno);
 
                        targs->idx = i;
-                       if (pthread_create(&ns_thread, NULL, nsswitchthread, (void *)targs))
+                       if (pthread_create(&ns_thread, NULL, nsswitchthread, targs))
                                exit_with_error(errno);
 
                        pthread_join(ns_thread, NULL);
@@ -923,12 +923,12 @@ static void testapp_validate(void)
 
        /*Spawn RX thread */
        if (!opt_bidi || (opt_bidi && !bidi_pass)) {
-               if (pthread_create(&t0, &attr, worker_testapp_validate, (void *)ifdict[1]))
+               if (pthread_create(&t0, &attr, worker_testapp_validate, ifdict[1]))
                        exit_with_error(errno);
        } else if (opt_bidi && bidi_pass) {
                /*switch Tx/Rx vectors */
                ifdict[0]->fv.vector = rx;
-               if (pthread_create(&t0, &attr, worker_testapp_validate, (void *)ifdict[0]))
+               if (pthread_create(&t0, &attr, worker_testapp_validate, ifdict[0]))
                        exit_with_error(errno);
        }
 
@@ -943,12 +943,12 @@ static void testapp_validate(void)
 
        /*Spawn TX thread */
        if (!opt_bidi || (opt_bidi && !bidi_pass)) {
-               if (pthread_create(&t1, &attr, worker_testapp_validate, (void *)ifdict[0]))
+               if (pthread_create(&t1, &attr, worker_testapp_validate, ifdict[0]))
                        exit_with_error(errno);
        } else if (opt_bidi && bidi_pass) {
                /*switch Tx/Rx vectors */
                ifdict[1]->fv.vector = tx;
-               if (pthread_create(&t1, &attr, worker_testapp_validate, (void *)ifdict[1]))
+               if (pthread_create(&t1, &attr, worker_testapp_validate, ifdict[1]))
                        exit_with_error(errno);
        }