coding style: remove useless return statement from void functions 22/5622/2
authorAntonio Borneo <borneo.antonio@gmail.com>
Mon, 6 May 2019 10:41:22 +0000 (12:41 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 9 May 2020 13:40:07 +0000 (14:40 +0100)
For void functions, a return as last statement is useless.
Remove it.

Issue identified by checkpatch script from Linux kernel v5.1 using
the command

find src/ -type f -exec ./tools/scripts/checkpatch.pl \
-q --types RETURN_VOID -f {} \;

Change-Id: Ie0616fe98623f30d2d7b04ac9517d669774092de
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5622
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
src/jtag/drivers/cmsis_dap_usb.c
src/jtag/drivers/sysfsgpio.c
src/jtag/drivers/xds110.c

index 2897377..ee1cb53 100644 (file)
@@ -364,8 +364,6 @@ static void cmsis_dap_usb_close(struct cmsis_dap *dap)
                free(pending_fifo[i].transfers);
                pending_fifo[i].transfers = NULL;
        }
-
-       return;
 }
 
 static int cmsis_dap_usb_write(struct cmsis_dap *dap, int txlen)
index e4a1523..a4d7ad9 100644 (file)
@@ -98,8 +98,6 @@ static void unexport_sysfs_gpio(int gpio)
        snprintf(gpiostr, sizeof(gpiostr), "%d", gpio);
        if (open_write_close("/sys/class/gpio/unexport", gpiostr) < 0)
                LOG_ERROR("Couldn't unexport gpio %d", gpio);
-
-       return;
 }
 
 /*
index 8a832ad..5e4df93 100644 (file)
@@ -1683,14 +1683,11 @@ static int xds110_reset(int trst, int srst)
 static void xds110_execute_sleep(struct jtag_command *cmd)
 {
        jtag_sleep(cmd->cmd.sleep->us);
-       return;
 }
 
 static void xds110_execute_tlr_reset(struct jtag_command *cmd)
 {
        (void)xds_goto_state(XDS_JTAG_STATE_RESET);
-
-       return;
 }
 
 static void xds110_execute_pathmove(struct jtag_command *cmd)
@@ -1726,8 +1723,6 @@ static void xds110_execute_pathmove(struct jtag_command *cmd)
        }
 
        free((void *)path);
-
-       return;
 }
 
 static void xds110_queue_scan(struct jtag_command *cmd)
@@ -1799,8 +1794,6 @@ static void xds110_queue_scan(struct jtag_command *cmd)
        }
        xds110.txn_request_size += total_bytes;
        xds110.txn_result_size += total_bytes;
-
-       return;
 }
 
 static void xds110_queue_runtest(struct jtag_command *cmd)
@@ -1820,8 +1813,6 @@ static void xds110_queue_runtest(struct jtag_command *cmd)
        xds110.txn_requests[xds110.txn_request_size++] = (clocks >> 16) & 0xff;
        xds110.txn_requests[xds110.txn_request_size++] = (clocks >> 24) & 0xff;
        xds110.txn_requests[xds110.txn_request_size++] = end_state;
-
-       return;
 }
 
 static void xds110_queue_stableclocks(struct jtag_command *cmd)
@@ -1838,8 +1829,6 @@ static void xds110_queue_stableclocks(struct jtag_command *cmd)
        xds110.txn_requests[xds110.txn_request_size++] = (clocks >>  8) & 0xff;
        xds110.txn_requests[xds110.txn_request_size++] = (clocks >> 16) & 0xff;
        xds110.txn_requests[xds110.txn_request_size++] = (clocks >> 24) & 0xff;
-
-       return;
 }
 
 static void xds110_execute_command(struct jtag_command *cmd)