From fdd4aef34003587d7fd9ed754dd35ce901b639bf Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Mon, 5 Jan 2015 18:44:36 +0100 Subject: Make thirty functions static to reduce binary size If any of those functions should be (unused) API functions, they can easily be turned back once really needed. Detected using a new cppcheck check that uses the internal symbol database to catch functions that are only used in the current file. Change-Id: Ic2b1e5b8020b76397f11cefc4e205f3b7ac1f184 --- firmware/drivers/ata_flash.c | 16 ++++++++-------- firmware/events.c | 2 +- firmware/ifp_usb_serial.c | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) (limited to 'firmware') diff --git a/firmware/drivers/ata_flash.c b/firmware/drivers/ata_flash.c index de2988b9be..96ea1cfa68 100644 --- a/firmware/drivers/ata_flash.c +++ b/firmware/drivers/ata_flash.c @@ -73,7 +73,7 @@ struct flash_disk static struct flash_disk flash_disk; -void flash_select_chip(int no, int sel) +static void flash_select_chip(int no, int sel) { #if CONFIG_FLASH == FLASH_IFP7XX if (sel) @@ -115,7 +115,7 @@ static void flash_wait_ready(void) static unsigned char model_n_sectors_order[] = {0, 19, 20}; -int flash_map_sector(int sector, int* chip, int* chip_sector) +static int flash_map_sector(int sector, int* chip, int* chip_sector) { int ord, c; if (flash_disk.model == FLASH_MODEL_NONE) @@ -132,7 +132,7 @@ int flash_map_sector(int sector, int* chip, int* chip_sector) return 0; } -int flash_read_id(int no) { +static int flash_read_id(int no) { int id; flash_select_chip(no, 1); @@ -146,7 +146,7 @@ int flash_read_id(int no) { return id; } -int flash_read_sector(int sector, unsigned char* buf, +static int flash_read_sector(int sector, unsigned char* buf, unsigned char* oob) { unsigned long *bufl = (unsigned long *)buf; @@ -204,7 +204,7 @@ int flash_read_sector(int sector, unsigned char* buf, return 0; } -int flash_read_sector_oob(int sector, unsigned char* oob) +static int flash_read_sector_oob(int sector, unsigned char* oob) { int chip, chip_sector; int i; @@ -294,7 +294,7 @@ static int flash_get_logical_block_no(unsigned char* oob) return -1; } -int flash_disk_scan(void) +static int flash_disk_scan(void) { int n_segments, n_phblocks; unsigned char oob[16]; @@ -327,7 +327,7 @@ int flash_disk_scan(void) return 0; } -int flash_disk_find_block(int block) +static int flash_disk_find_block(int block) { int seg, bmod, phb; unsigned char oob[16]; @@ -356,7 +356,7 @@ int flash_disk_find_block(int block) return flash_disk.cur_phblock_start; } -int flash_disk_read_sectors(unsigned long start, +static int flash_disk_read_sectors(unsigned long start, int count, void* buf) { diff --git a/firmware/events.c b/firmware/events.c index 3386c02465..8015442cc2 100644 --- a/firmware/events.c +++ b/firmware/events.c @@ -81,7 +81,7 @@ bool add_event_ex(unsigned short id, bool oneshot, void (*handler)(unsigned shor return do_add_event(id, oneshot, true, handler, user_data); } -void do_remove_event(unsigned short id, bool user_data_valid, +static void do_remove_event(unsigned short id, bool user_data_valid, void *handler, void *user_data) { int i; diff --git a/firmware/ifp_usb_serial.c b/firmware/ifp_usb_serial.c index 5392de0d52..f7e3a51858 100644 --- a/firmware/ifp_usb_serial.c +++ b/firmware/ifp_usb_serial.c @@ -250,7 +250,7 @@ static inline void usb_select_setup_endpoint(void) ISP1582_EPINDEX = 0x20; } -void usb_setup_endpoint(int idx, int max_pkt_size, int type) +static void usb_setup_endpoint(int idx, int max_pkt_size, int type) { struct usb_endpoint *ep; @@ -271,7 +271,7 @@ void usb_setup_endpoint(int idx, int max_pkt_size, int type) ep->max_pkt_size[epidx_dir(idx)] = max_pkt_size; } -void usb_disable_endpoint(int idx) +static void usb_disable_endpoint(int idx) { usb_select_endpoint(idx); ISP1582_EPTYPE &= 8; @@ -288,12 +288,12 @@ void usb_reconnect(void) ISP1582_MODE |= 1; /* SOFTCT on */ } -void usb_cleanup(void) +static void usb_cleanup(void) { ISP1582_MODE &= ~1; /* SOFTCT off */ } -void usb_setup(int reset) +static void usb_setup(int reset) { int i; @@ -840,7 +840,7 @@ static void usb_handle_int(int i) } -void usb_handle_interrupts(void) +static void usb_handle_interrupts(void) { #ifdef LCD_DEBUG char s[20]; @@ -1002,7 +1002,7 @@ static void serial_free_out_fifo(int ep, unsigned char *buf, int len) serial_restart_output(ep); } -void usb_serial_handle(void) +static void usb_serial_handle(void) { #ifdef BUTTONS static int t = 0; -- cgit v1.2.3