diff --git a/userspace/libwr/Makefile b/userspace/libwr/Makefile index 0d9da0778f50719833e9f10b083e95dd1235cd29..4446ea2b5acb16df5e79747334cefdd9bdfda7e3 100644 --- a/userspace/libwr/Makefile +++ b/userspace/libwr/Makefile @@ -20,6 +20,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump CFLAGS = -Wall -I. -O2 -ggdb \ + -Wstrict-prototypes \ -DLIBWR_INTERNAL \ -I./include \ -I../include \ diff --git a/userspace/libwr/fan.c b/userspace/libwr/fan.c index ffa32fa6f111afd49005edc7d095b1de2f3fb31b..5654b1f591a09a49d2bdd4605e3a2cc50abca59f 100644 --- a/userspace/libwr/fan.c +++ b/userspace/libwr/fan.c @@ -198,7 +198,7 @@ static float tmp100_read_temp(int dev_addr) return ((float)(temp >> 4)) / 16.0; } -static int shw_init_i2c_sensors() +static int shw_init_i2c_sensors(void) { if (i2c_init_bus(&fpga_sensors_i2c) < 0) { pr_error( diff --git a/userspace/libwr/i2c_io.c b/userspace/libwr/i2c_io.c index 428a4579182fb73a6289bbb1fd6619461126f01d..4afe03049e011dcd152ec4e5c81bffd58edea30a 100644 --- a/userspace/libwr/i2c_io.c +++ b/userspace/libwr/i2c_io.c @@ -95,7 +95,7 @@ int shw_i2c_io_scan(uint8_t * dev_map) return detect; } -int shw_get_hw_ver() +int shw_get_hw_ver(void) { uint8_t ret; struct i2c_bus *bus = &i2c_io_bus; @@ -125,7 +125,7 @@ int shw_get_hw_ver() } } -uint8_t shw_get_fpga_type() +uint8_t shw_get_fpga_type(void) { struct i2c_bus *bus = &i2c_io_bus; diff --git a/userspace/libwr/i2c_io.h b/userspace/libwr/i2c_io.h index 3ce1c81ea44dfdc645c54bae16347bb394e2ad03..c77ceff93c0b2927cd5d193ea73bcb238694d268 100644 --- a/userspace/libwr/i2c_io.h +++ b/userspace/libwr/i2c_io.h @@ -22,7 +22,7 @@ extern struct i2c_bus i2c_io_bus; int shw_i2c_io_init(void); int shw_i2c_io_scan(uint8_t * dev_map); -int shw_get_hw_ver(); -uint8_t shw_get_fpga_type(); +int shw_get_hw_ver(void); +uint8_t shw_get_fpga_type(void); #endif //I2C_IO_H diff --git a/userspace/libwr/include/libwr/pio.h b/userspace/libwr/include/libwr/pio.h index 9c40f5934e555ae594a543ee77fac8aba5bc191a..25ef687f775cf65f702bb1af8b967d2afd0dc344 100644 --- a/userspace/libwr/include/libwr/pio.h +++ b/userspace/libwr/include/libwr/pio.h @@ -51,11 +51,11 @@ void shw_pio_configure(const pio_pin_t * pin); void shw_pio_configure_pins(const pio_pin_t * pins); int shw_clock_out_enable(int pck_num, int prescaler, int source); -volatile uint8_t *shw_pio_get_sys_base(); +volatile uint8_t *shw_pio_get_sys_base(void); volatile uint8_t *shw_pio_get_port_base(int port); void shw_set_fp_led(int led, int state); -int shw_pio_mmap_init(); +int shw_pio_mmap_init(void); void shw_pio_toggle_pin(pio_pin_t * pin, uint32_t udelay); void shw_pio_configure(const pio_pin_t * pin); diff --git a/userspace/libwr/include/libwr/pps_gen.h b/userspace/libwr/include/libwr/pps_gen.h index 2a21bb0d1438353c0458439d42c27a72c6106eed..43e5009c30d9dc1b9b2c660a2aff0ac7b4b7adff 100644 --- a/userspace/libwr/include/libwr/pps_gen.h +++ b/userspace/libwr/include/libwr/pps_gen.h @@ -10,13 +10,13 @@ #define PPSG_ADJUST_NSEC 0x2 /* Initializes the PPS Generator. 0 on success, negative on failure. */ -int shw_pps_gen_init(); +int shw_pps_gen_init(void); /* Adjusts the <counter> (PPSG_ADJUST_SEC/NSEC) by (how_much) seconds/nanoseconds */ int shw_pps_gen_adjust(int counter, int64_t how_much); /* Returns 1 when the PPS is busy adjusting its time counters, 0 if PPS gen idle */ -int shw_pps_gen_busy(); +int shw_pps_gen_busy(void); /* Enables/disables PPS Generator PPS output */ int shw_pps_gen_enable_output(int enable); diff --git a/userspace/libwr/include/libwr/ptpd_netif.h b/userspace/libwr/include/libwr/ptpd_netif.h index 14618fe42cb88a82648a286cc5aae3f34d1fb912..05de972ecfdd35e8f4ead01b9e9054eaba811d6e 100644 --- a/userspace/libwr/include/libwr/ptpd_netif.h +++ b/userspace/libwr/include/libwr/ptpd_netif.h @@ -77,7 +77,7 @@ struct wr_tstamp { // - opens devices // - does necessary ioctls() // - initializes connection with the mighty HAL daemon -int ptpd_netif_init(); +int ptpd_netif_init(void); // Creates UDP or Ethernet RAW socket (determined by sock_type) bound to bind_addr. If PTPD_FLAG_MULTICAST is set, the socket is // automatically added to multicast group. User can specify physical_port field to bind the socket to specific switch port only. diff --git a/userspace/libwr/include/libwr/shw_io.h b/userspace/libwr/include/libwr/shw_io.h index 29e85e96b629bb8eb39c1321eacdefc2ac6b73dc..5ae6c4e4933c4d4d1c522600885e1673610abed4 100644 --- a/userspace/libwr/include/libwr/shw_io.h +++ b/userspace/libwr/include/libwr/shw_io.h @@ -90,8 +90,8 @@ typedef struct { extern const shw_io_t _all_shw_io[]; //Functions -int shw_io_init(); -int shw_io_configure_all(); +int shw_io_init(void); +int shw_io_configure_all(void); const shw_io_t *get_shw_io(shw_io_id_t id); const pio_pin_t *get_pio_pin(shw_io_id_t id); uint32_t shw_io_read(shw_io_id_t id); diff --git a/userspace/libwr/include/libwr/util.h b/userspace/libwr/include/libwr/util.h index eb85d22ec90aea42c8fdbc7b2041f702cf37ec30..e13d48fd611cbfddba1006a5b01252a40b635036 100644 --- a/userspace/libwr/include/libwr/util.h +++ b/userspace/libwr/include/libwr/util.h @@ -8,6 +8,6 @@ void shw_udelay_init(void); void shw_udelay(uint32_t microseconds); -uint64_t shw_get_tics(); +uint64_t shw_get_tics(void); #endif /* __LIBWR_HW_UTIL_H */ diff --git a/userspace/libwr/init.c b/userspace/libwr/init.c index fda5cc135c37318e53ac8f11b22d888ac77a01e6..d3f683dffe3000e6939215ae0f983ee3c136e51f 100644 --- a/userspace/libwr/init.c +++ b/userspace/libwr/init.c @@ -35,7 +35,7 @@ int shw_init() return 0; } -int shw_exit_fatal() +int shw_exit_fatal(void) { pr_error("exiting due to fatal error.\n"); exit(-1); diff --git a/userspace/libwr/ptpd_netif.c b/userspace/libwr/ptpd_netif.c index 0144786987633574d9bfb81cb8ebaefff6fac168..fdb34b3788c42807637e410facccaccb2bef5d05 100644 --- a/userspace/libwr/ptpd_netif.c +++ b/userspace/libwr/ptpd_netif.c @@ -48,7 +48,7 @@ struct etherpacket { char data[ETH_DATA_LEN]; }; -static uint64_t get_tics() +static uint64_t get_tics(void) { struct timezone tz = { 0, 0 }; struct timeval tv; diff --git a/userspace/tools/Makefile b/userspace/tools/Makefile index 9c1989ee64cc9c6ebbbdc4a0d38ff282203a3cd6..b8860eb0eef67486ff9be1e1267cf580eaa0b448 100644 --- a/userspace/tools/Makefile +++ b/userspace/tools/Makefile @@ -26,6 +26,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump # LOTs of includes CFLAGS = -O2 -g -Wall \ + -Wstrict-prototypes \ -I$(LINUX)/include \ -I$(LINUX)/arch/arm/mach-at91/include \ -I../wrsw_rtud \ diff --git a/userspace/tools/wr_mon.c b/userspace/tools/wr_mon.c index 19a783a2d93e494be2880972a47b47b25e49fc6b..506ef242f0296b70e99a8631df589acaa6053a92 100644 --- a/userspace/tools/wr_mon.c +++ b/userspace/tools/wr_mon.c @@ -80,7 +80,7 @@ int read_servo(void){ } -void ppsi_connect_minipc() +void ppsi_connect_minipc(void) { if (ptp_ch) { /* close minipc, if connected before */ @@ -421,7 +421,7 @@ void show_temperatures(void) int track_onoff = 1; -void show_all() +void show_all(void) { int hal_alive; int ppsi_alive; diff --git a/userspace/tools/wr_phytool.c b/userspace/tools/wr_phytool.c index 12b6aaa8f2b498761dc75e7b66ecc4e2f9fbc347..0c0c4c48146ac1ebf1016c9084ed472203b5fb1c 100644 --- a/userspace/tools/wr_phytool.c +++ b/userspace/tools/wr_phytool.c @@ -211,7 +211,7 @@ static struct { int hits; } bslides[MAX_BITSLIDES]; -int bslide_bins() +int bslide_bins(void) { int i, hits = 0; @@ -241,7 +241,7 @@ void sighandler(int sig) quit = 1; } -static void print_cal_stats() +static void print_cal_stats(void) { int i,last_occupied = -1; printf("Calibration statistics: \n"); diff --git a/userspace/tools/wrs_vlans.c b/userspace/tools/wrs_vlans.c index b3794ad084a9b45e65c3e2438eab4e19bc2c26b6..f30f4cb378002dee46637e42090f0bf50f17fd1e 100644 --- a/userspace/tools/wrs_vlans.c +++ b/userspace/tools/wrs_vlans.c @@ -67,10 +67,10 @@ static struct s_port_vlans vlans[NPORTS]; static unsigned long portmask; -static int print_help(); +static int print_help(char *prgname); static void print_config(struct s_port_vlans *vlans); static int apply_settings(struct s_port_vlans *vlans); -static int clear_all(); +static int clear_all(void); static int set_rtu_vlan(int vid, int fid, int pmask, int drop, int prio, int del, int flags); static void free_rtu_vlans(struct rtu_vlans_t *ptr); @@ -503,7 +503,7 @@ static void list_ep_vlans(void) return; } -static int clear_all() +static int clear_all(void) { uint32_t r; int val, i; diff --git a/userspace/wrs_watchdog/Makefile b/userspace/wrs_watchdog/Makefile index e67893764e5055b0d1200cebddf9f67839c97f47..99a034093bac1268c41df2597d314f7d09754a56 100644 --- a/userspace/wrs_watchdog/Makefile +++ b/userspace/wrs_watchdog/Makefile @@ -17,6 +17,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump CFLAGS = -O -g -Wall \ + -Wstrict-prototypes \ -I../include \ -I../libwr/include \ -I../mini-rpc \ diff --git a/userspace/wrsw_hal/Makefile b/userspace/wrsw_hal/Makefile index b73d263c3c8d46675a1d5d53f2cd5f61617ee66a..80af335af10a75d693e95ff07ce04db8e785b7c0 100644 --- a/userspace/wrsw_hal/Makefile +++ b/userspace/wrsw_hal/Makefile @@ -17,6 +17,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump CFLAGS = -O -g -Wall \ + -Wstrict-prototypes \ -I../include \ -I../libwr/include \ -I../mini-rpc \ diff --git a/userspace/wrsw_hal/hal_exports.c b/userspace/wrsw_hal/hal_exports.c index 110cf72e6225e4d060c14be7bce6d6b74ff7e3ba..61daea14f15f2e04e979245d030fc0061b82285a 100644 --- a/userspace/wrsw_hal/hal_exports.c +++ b/userspace/wrsw_hal/hal_exports.c @@ -142,9 +142,9 @@ int halexp_pps_cmd(int cmd, hexp_pps_params_t * params) return -1; /* fixme: real error code */ } -extern int hal_port_any_locked(); +extern int hal_port_any_locked(void); -static void hal_cleanup_wripc() +static void hal_cleanup_wripc(void) { minipc_close(hal_ch); } diff --git a/userspace/wrsw_hal/hal_main.c b/userspace/wrsw_hal/hal_main.c index 0d3b38ea3076827574e89fd6b367600255e0e104..e85fae401907c46dfac7e577425af22065ea4eda 100644 --- a/userspace/wrsw_hal/hal_main.c +++ b/userspace/wrsw_hal/hal_main.c @@ -43,7 +43,7 @@ int hal_add_cleanup_callback(hal_cleanup_callback_t cb) } /* Calls all cleanup callbacks */ -static void call_cleanup_cbs() +static void call_cleanup_cbs(void) { int i; @@ -65,16 +65,16 @@ static void sighandler(int sig) exit(0); } -static int hal_shutdown() +static int hal_shutdown(void) { call_cleanup_cbs(); return 0; } -static void hal_daemonize(); +static void hal_daemonize(void); /* Main initialization function */ -static int hal_init() +static int hal_init(void) { //trace_log_stderr(); @@ -113,7 +113,7 @@ static int hal_init() } /* Turns a nice and well-behaving HAL into an evil servant of satan. */ -static void hal_daemonize() +static void hal_daemonize(void) { pid_t pid, sid; @@ -152,7 +152,7 @@ static void hal_daemonize() freopen("/dev/null", "r", stdin); } -static void show_help() +static void show_help(void) { printf("WR Switch Hardware Abstraction Layer daemon (wrsw_hal)\n\ Usage: wrsw_hal [options], where [options] can be:\n\ diff --git a/userspace/wrsw_hal/hal_ports.c b/userspace/wrsw_hal/hal_ports.c index b7232fa3f42069182723bd27c4ddae78fc0c2cb9..b558edd449d56e7c08cf948b3908159f3c115b86 100644 --- a/userspace/wrsw_hal/hal_ports.c +++ b/userspace/wrsw_hal/hal_ports.c @@ -51,7 +51,7 @@ static int hal_port_nports; int hal_port_check_lock(const char *port_name); -int hal_port_any_locked() +int hal_port_any_locked(void) { if (!hal_port_rts_state_valid) return -1; @@ -286,7 +286,7 @@ int hal_port_pshifter_busy() /* Updates the current value of the phase shift on a given * port. Called by the main update function regularly. */ -static void poll_rts_state() +static void poll_rts_state(void) { struct rts_pll_state *hs = &hal_port_rts_state; @@ -530,7 +530,7 @@ static void hal_port_remove_sfp(struct hal_port_state * p) } /* detects insertion/removal of SFP transceivers */ -static void hal_port_poll_sfp() +static void hal_port_poll_sfp(void) { if (tmo_expired(&hal_port_tmo_sfp)) { uint32_t mask = shw_sfp_module_scan(); diff --git a/userspace/wrsw_hal/timeout.h b/userspace/wrsw_hal/timeout.h index 3a8fa17e9039f992ec12115f818fea28e38348f4..cb7f989e3b67cd01243d49c81cd0fab0e9810422 100644 --- a/userspace/wrsw_hal/timeout.h +++ b/userspace/wrsw_hal/timeout.h @@ -11,7 +11,7 @@ typedef struct { uint64_t timeout; } timeout_t; -static inline uint64_t tm_get_tics() +static inline uint64_t tm_get_tics(void) { struct timezone tz = { 0, 0 }; struct timeval tv; diff --git a/userspace/wrsw_hal/wrsw_hal.h b/userspace/wrsw_hal/wrsw_hal.h index b82ad1d1fb3325e172e2541ba00003336a21634f..105da2a958b4d05955a226d2962f4a470898fcb2 100644 --- a/userspace/wrsw_hal/wrsw_hal.h +++ b/userspace/wrsw_hal/wrsw_hal.h @@ -3,7 +3,7 @@ #include <inttypes.h> -typedef void (*hal_cleanup_callback_t)(); +typedef void (*hal_cleanup_callback_t)(void); int hal_check_running(void); diff --git a/userspace/wrsw_rtud/Makefile b/userspace/wrsw_rtud/Makefile index 8c4a4fe13c4df57e911fba61f4fa8885f2386258..6a2e2aedf709e7fde6aa22c62c4d6b3cd626aeab 100644 --- a/userspace/wrsw_rtud/Makefile +++ b/userspace/wrsw_rtud/Makefile @@ -18,6 +18,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump CFLAGS = -O2 -Wall -ggdb \ + -Wstrict-prototypes \ -I../mini-rpc \ -I../include \ -I../libwr/include \ diff --git a/userspace/wrsw_rtud/rtu.h b/userspace/wrsw_rtud/rtu.h index e236811a7c81d889a70223285729dbe43c339d2e..2030fdfb403eda23065768b204fb384864def72e 100644 --- a/userspace/wrsw_rtud/rtu.h +++ b/userspace/wrsw_rtud/rtu.h @@ -96,12 +96,12 @@ static inline struct rtu_filtering_entry *rtu_fe_clean( /** * \brief Returns number of seconds since the epoch. */ -static inline unsigned long now() +static inline unsigned long now(void) { return (unsigned long)time(NULL); } -int rtud_init_exports(); -void rtud_handle_wripc(); +int rtud_init_exports(void); +void rtud_handle_wripc(void); #endif /*__WHITERABBIT_RTU_H*/ diff --git a/userspace/wrsw_rtud/rtu_drv.c b/userspace/wrsw_rtud/rtu_drv.c index 7b8619b48e7d75dd2bb77b459841fde12db32086..ad627e250d874b9147f1932dc368176883305933 100644 --- a/userspace/wrsw_rtud/rtu_drv.c +++ b/userspace/wrsw_rtud/rtu_drv.c @@ -301,7 +301,7 @@ int rtu_mfifo_is_empty(void) return RTU_MFIFO_CSR_EMPTY & csr; } -static void flush_mfifo() +static void flush_mfifo(void) { uint32_t gcr = rtu_rd(GCR); rtu_wr(GCR, gcr | RTU_GCR_MFIFOTRIG); diff --git a/userspace/wrsw_rtud/rtu_ext_drv.h b/userspace/wrsw_rtud/rtu_ext_drv.h index 8af7a235356d49e9446b88a71e6a050f89d705b7..4246da1bdda1c1139006d63ace0ee9159743184a 100644 --- a/userspace/wrsw_rtud/rtu_ext_drv.h +++ b/userspace/wrsw_rtud/rtu_ext_drv.h @@ -37,9 +37,9 @@ void rtux_add_ff_mac_range(int mac_id, int valid, uint8_t mac_lower[ETH_ALEN], void rtux_set_port_mirror(uint32_t mirror_src_mask, uint32_t mirror_dst_mask, int rx, int tx); void rtux_set_hp_prio_mask(uint8_t hp_prio_mask); -uint8_t rtux_get_hp_prio_mask(); +uint8_t rtux_get_hp_prio_mask(void); -int rtux_get_cpu_port(); +int rtux_get_cpu_port(void); void rtux_set_feature_ctrl(int mr, int mac_ptp, int mac_ll, int mac_single, int mac_range, int mac_br, int at_fm); void rtux_set_fw_to_CPU(int hp, int unrec); diff --git a/userspace/wrsw_rtud/rtud.c b/userspace/wrsw_rtud/rtud.c index 9eeb722459a5937ea83ff257ed542ca7304d05ae..555a7f0a7e336fbb4a36f0aae93b87e3ab819606 100644 --- a/userspace/wrsw_rtud/rtud.c +++ b/userspace/wrsw_rtud/rtud.c @@ -88,7 +88,7 @@ int read_ports(void){ * @return error code */ -static int rtu_create_static_entries() +static int rtu_create_static_entries(void) { uint8_t bcast_mac[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; uint8_t slow_proto_mac[] = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x01 }; @@ -149,7 +149,7 @@ static int rtu_create_static_entries() return 0; } -static void rtu_update_ports_state() +static void rtu_update_ports_state(void) { int i; int link_up; @@ -209,7 +209,7 @@ static void *rtu_daemon_wripc_process(void *arg) * \brief Handles the learning process. * @return error code */ -static int rtu_daemon_learning_process() +static int rtu_daemon_learning_process(void) { int err, i, port_down; struct rtu_request req; // Request read from learning queue @@ -322,7 +322,7 @@ static int rtu_daemon_init(uint16_t poly, unsigned long aging_time) /** * \brief RTU shutdown. */ -static void rtu_daemon_destroy() +static void rtu_daemon_destroy(void) { // Threads stuff pthread_cancel(wripc_process);