coding style: prototype of functions with no parameters
authorAntonio Borneo <borneo.antonio@gmail.com>
Mon, 6 May 2019 10:31:57 +0000 (12:31 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 9 May 2020 13:39:59 +0000 (14:39 +0100)
Functions that have no parameters should use "void" as parameter
in the function declaration.

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

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

Change-Id: If104ac75b44e939ec86155ff7b5720f2e33c6b39
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5621
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
src/helper/log.c
src/jtag/core.c
src/jtag/drivers/arm-jtag-ew.c
src/jtag/interface.c
src/jtag/minidummy/minidummy.c
src/jtag/zy1000/zy1000.c

index ae26df5a1cf7c3913141c9de16ec92aa23e1eee1..380f548f42ed49f824ebeab25b4c61e16b5afd18 100644 (file)
@@ -401,7 +401,7 @@ char *alloc_printf(const char *format, ...)
  * fast when invoked more often than every 500ms.
  *
  */
-void keep_alive()
+void keep_alive(void)
 {
        current_time = timeval_ms();
        if (current_time-last_time > 1000) {
@@ -436,7 +436,7 @@ void keep_alive()
 }
 
 /* reset keep alive timer without sending message */
-void kept_alive()
+void kept_alive(void)
 {
        current_time = timeval_ms();
        last_time = current_time;
index f12ab592495b996b0590bfb1ee7829da4c10922d..884a743650e389ac31d9a445298a7263a545c5e7 100644 (file)
@@ -1872,7 +1872,7 @@ void jtag_set_verify(bool enable)
        jtag_verify = enable;
 }
 
-bool jtag_will_verify()
+bool jtag_will_verify(void)
 {
        return jtag_verify;
 }
@@ -1882,7 +1882,7 @@ void jtag_set_verify_capture_ir(bool enable)
        jtag_verify_capture_ir = enable;
 }
 
-bool jtag_will_verify_capture_ir()
+bool jtag_will_verify_capture_ir(void)
 {
        return jtag_verify_capture_ir;
 }
index d35e15128df25991e39b332d0293372eee7261f7..405278b9a1596d7d86da708720f7ddc18bac22a7 100644 (file)
@@ -683,7 +683,7 @@ static int armjtagew_tap_execute(void)
 /****************************************************************************
  * JLink USB low-level functions */
 
-static struct armjtagew *armjtagew_usb_open()
+static struct armjtagew *armjtagew_usb_open(void)
 {
        usb_init();
 
index de132bbe8e2f24317247922a7d1dd1675d4dc545..56bbf6e51bc9624e31c8a29ccd0bec7f3c66e4b8 100644 (file)
@@ -45,7 +45,7 @@ void tap_set_state_impl(tap_state_t new_state)
        state_follower = new_state;
 }
 
-tap_state_t tap_get_state()
+tap_state_t tap_get_state(void)
 {
        return state_follower;
 }
@@ -64,7 +64,7 @@ void tap_set_end_state(tap_state_t new_end_state)
        end_state_follower = new_end_state;
 }
 
-tap_state_t tap_get_end_state()
+tap_state_t tap_get_end_state(void)
 {
        return end_state_follower;
 }
index 7d5e6a98a646a11b4000c7ec63a0cb7d0b8df3b1..7ee206732b3ee79848f64550c2b03d988699e038 100644 (file)
@@ -83,7 +83,7 @@ int interface_jtag_add_plain_dr_scan(int num_bits, const uint8_t *out_bits,
        return ERROR_OK;
 }
 
-int interface_jtag_add_tlr()
+int interface_jtag_add_tlr(void)
 {
        /* synchronously do the operation here */
 
index 48a3d4d039dbc295874f8e5a620ce24919e313a1..37af2f7ae4054404640c49690d3f3f4edeaea8c9 100644 (file)
@@ -486,7 +486,7 @@ int interface_jtag_add_plain_dr_scan(int num_bits,
        return ERROR_OK;
 }
 
-int interface_jtag_add_tlr()
+int interface_jtag_add_tlr(void)
 {
        setCurrentState(TAP_RESET);
        return ERROR_OK;