diff options
author | Elyes HAOUAS <ehaouas@noos.fr> | 2020-08-19 21:49:34 +0200 |
---|---|---|
committer | Michael Niewöhner <foss@mniewoehner.de> | 2020-09-21 16:20:57 +0000 |
commit | 3ff7bcf10e0d07f71ece45267d31ae1f83b04701 (patch) | |
tree | 8505dff0b98bee6a50fa10a5ec1a90536ec51fec /payloads/libpayload | |
parent | 99e0c7ddc1004b69df65483c029ee8915650223a (diff) |
payloads: Drop unneeded empty lines
Change-Id: I6faeb7c783052edc4217d2d301dbb905e1fc6a19
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44605
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
Diffstat (limited to 'payloads/libpayload')
47 files changed, 0 insertions, 80 deletions
diff --git a/payloads/libpayload/arch/arm64/virtual.c b/payloads/libpayload/arch/arm64/virtual.c index 2d336e301e..9450ac0d86 100644 --- a/payloads/libpayload/arch/arm64/virtual.c +++ b/payloads/libpayload/arch/arm64/virtual.c @@ -30,7 +30,6 @@ unsigned long virtual_offset = 0; - int getpagesize(void) { return 4096; diff --git a/payloads/libpayload/arch/x86/apic.c b/payloads/libpayload/arch/x86/apic.c index 62011612a5..e0671064c8 100644 --- a/payloads/libpayload/arch/x86/apic.c +++ b/payloads/libpayload/arch/x86/apic.c @@ -127,7 +127,6 @@ void apic_start_delay(unsigned int usec) enable_interrupts(); } - void apic_wait_delay(void) { /* Loop in case another interrupt has fired and resumed execution. */ diff --git a/payloads/libpayload/arch/x86/delay.c b/payloads/libpayload/arch/x86/delay.c index df2c0ac9ba..373c8417b3 100644 --- a/payloads/libpayload/arch/x86/delay.c +++ b/payloads/libpayload/arch/x86/delay.c @@ -38,7 +38,6 @@ /* Let's assume APIC interrupts take at least 100us */ #define APIC_INTERRUPT_LATENCY_NS (100 * NSECS_PER_USEC) - void arch_ndelay(uint64_t ns) { uint64_t delta = ns * timer_hz() / NSECS_PER_SEC; diff --git a/payloads/libpayload/arch/x86/virtual.c b/payloads/libpayload/arch/x86/virtual.c index 2d336e301e..9450ac0d86 100644 --- a/payloads/libpayload/arch/x86/virtual.c +++ b/payloads/libpayload/arch/x86/virtual.c @@ -30,7 +30,6 @@ unsigned long virtual_offset = 0; - int getpagesize(void) { return 4096; diff --git a/payloads/libpayload/crypto/sha1.c b/payloads/libpayload/crypto/sha1.c index fce96a3463..5f54431a82 100644 --- a/payloads/libpayload/crypto/sha1.c +++ b/payloads/libpayload/crypto/sha1.c @@ -115,7 +115,6 @@ SHA1Transform(u_int32_t state[5], const u_int8_t buffer[SHA1_BLOCK_LENGTH]) a = b = c = d = e = 0; } - /* * SHA1Init - Initialize new context */ @@ -132,7 +131,6 @@ SHA1Init(SHA1_CTX *context) context->state[4] = 0xC3D2E1F0; } - /* * Run your data through this. */ @@ -155,7 +153,6 @@ SHA1Update(SHA1_CTX *context, const u_int8_t *data, size_t len) (void)memcpy(&context->buffer[j], &data[i], len - i); } - /* * Add padding and return the message digest. */ diff --git a/payloads/libpayload/curses/PDCurses/demos/tui.c b/payloads/libpayload/curses/PDCurses/demos/tui.c index 62e0d53767..41f34ba410 100644 --- a/payloads/libpayload/curses/PDCurses/demos/tui.c +++ b/payloads/libpayload/curses/PDCurses/demos/tui.c @@ -46,14 +46,12 @@ void rmerror(void); # define EDITBOXCOLOR (A_BOLD | A_REVERSE) #endif - #define th 1 /* title window height */ #define mh 1 /* main menu height */ #define sh 2 /* status window height */ #define bh (LINES - th - mh - sh) /* body window height */ #define bw COLS /* body window width */ - /******************************* STATIC ************************************/ static WINDOW *wtitl, *wmain, *wbody, *wstat; /* title, menu, body, status win*/ @@ -360,7 +358,6 @@ static void cleanup(void) /* cleanup curses settings */ } } - /******************************* EXTERNAL **********************************/ void clsbody(void) diff --git a/payloads/libpayload/curses/PDCurses/x11/ScrollBox.c b/payloads/libpayload/curses/PDCurses/x11/ScrollBox.c index e77d2c78ce..b96a027282 100644 --- a/payloads/libpayload/curses/PDCurses/x11/ScrollBox.c +++ b/payloads/libpayload/curses/PDCurses/x11/ScrollBox.c @@ -116,7 +116,6 @@ ScrollBoxClassRec scrollBoxClassRec = { WidgetClass scrollBoxWidgetClass = (WidgetClass)&scrollBoxClassRec; - /************************************************************************ * * * Private Routines * diff --git a/payloads/libpayload/curses/PDCurses/x11/ScrollBox.h b/payloads/libpayload/curses/PDCurses/x11/ScrollBox.h index 5825862744..9ba7d67331 100644 --- a/payloads/libpayload/curses/PDCurses/x11/ScrollBox.h +++ b/payloads/libpayload/curses/PDCurses/x11/ScrollBox.h @@ -42,7 +42,6 @@ */ - /* Class record constants */ extern WidgetClass scrollBoxWidgetClass; diff --git a/payloads/libpayload/curses/PDCurses/x11/ScrollBoxP.h b/payloads/libpayload/curses/PDCurses/x11/ScrollBoxP.h index 44551386bc..902edeebb7 100644 --- a/payloads/libpayload/curses/PDCurses/x11/ScrollBoxP.h +++ b/payloads/libpayload/curses/PDCurses/x11/ScrollBoxP.h @@ -56,7 +56,6 @@ typedef struct { XtGeometryMask last_query_mode; } ScrollBoxPart; - /************************************************************************ * * * Full instance record declaration * diff --git a/payloads/libpayload/curses/PDCurses/x11/x11.c b/payloads/libpayload/curses/PDCurses/x11/x11.c index 69c3199b54..46444d4471 100644 --- a/payloads/libpayload/curses/PDCurses/x11/x11.c +++ b/payloads/libpayload/curses/PDCurses/x11/x11.c @@ -276,7 +276,6 @@ static char *program_name; #define RCOLOR(name, value) RPIXEL(color##name, Color##name, value) - #define RSTRINGP(name1, name2, param) { \ #name1, #name2, XtRString, \ MAX_PATH, APPDATAOFF(name1), XtRString, (XtPointer)param \ diff --git a/payloads/libpayload/curses/curses.priv.h b/payloads/libpayload/curses/curses.priv.h index 78b7ff3cc9..31ec80f1bb 100644 --- a/payloads/libpayload/curses/curses.priv.h +++ b/payloads/libpayload/curses/curses.priv.h @@ -32,7 +32,6 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ - /* * $Id: curses.priv.h,v 1.314 2006/12/10 00:55:14 tom Exp $ * @@ -497,7 +496,6 @@ struct screen { chtype * _acs_map; /* the real alternate-charset map */ bool * _screen_acs_map; - /* used in lib_vidattr.c */ bool _use_rmso; /* true if we may use 'rmso' */ bool _use_rmul; /* true if we may use 'rmul' */ @@ -980,7 +978,6 @@ extern NCURSES_EXPORT(void) name (void); \ }\ TR(TRACE_ATTRS, ("new attribute is %s", _traceattr((S))));} - #define toggle_attr_off(S,at) {\ if (PAIR_NUMBER(at) > 0) {\ (S) &= ~(at|A_COLOR);\ diff --git a/payloads/libpayload/curses/form/form.h b/payloads/libpayload/curses/form/form.h index d7bb85adf4..2f55e42591 100644 --- a/payloads/libpayload/curses/form/form.h +++ b/payloads/libpayload/curses/form/form.h @@ -106,7 +106,6 @@ typedef struct fieldnode { NCURSES_FIELD_INTERNALS } FIELD; - /********* * FORM * *********/ @@ -138,7 +137,6 @@ typedef struct formnode { } FORM; - /************** * FIELDTYPE * **************/ diff --git a/payloads/libpayload/curses/menu/menu.h b/payloads/libpayload/curses/menu/menu.h index 1fdd9e795d..1df980c551 100644 --- a/payloads/libpayload/curses/menu/menu.h +++ b/payloads/libpayload/curses/menu/menu.h @@ -132,7 +132,6 @@ typedef struct tagMENU } MENU; - /* Define keys */ #define REQ_LEFT_ITEM (KEY_MAX + 1) @@ -170,7 +169,6 @@ typedef struct tagMENU # define MAX_COMMAND (KEY_MAX + 128) #endif - /* --------- prototypes for libmenu functions ----------------------------- */ extern NCURSES_EXPORT(ITEM **) menu_items (const MENU *); @@ -244,7 +242,6 @@ extern NCURSES_EXPORT(int) menu_request_by_name (const char *); extern NCURSES_EXPORT(int) set_menu_spacing (MENU *,int,int,int); extern NCURSES_EXPORT(int) menu_spacing (const MENU *,int *,int *,int *); - extern NCURSES_EXPORT(bool) item_value (const ITEM *); extern NCURSES_EXPORT(bool) item_visible (const ITEM *); diff --git a/payloads/libpayload/curses/menu/mf_common.h b/payloads/libpayload/curses/menu/mf_common.h index 681672dc34..d40c7b9806 100644 --- a/payloads/libpayload/curses/menu/mf_common.h +++ b/payloads/libpayload/curses/menu/mf_common.h @@ -66,7 +66,6 @@ extern int errno; #define MODULE_ID(id) /*nothing*/ #endif - /* Maximum regular 8-bit character code */ #define MAX_REGULAR_CHARACTER (0xff) diff --git a/payloads/libpayload/curses/tinycurses.c b/payloads/libpayload/curses/tinycurses.c index ffd9bd4769..d3bf84efab 100644 --- a/payloads/libpayload/curses/tinycurses.c +++ b/payloads/libpayload/curses/tinycurses.c @@ -163,7 +163,6 @@ chtype console_acs_map[128] = // FIXME: Ugly (and insecure!) hack! char sprintf_tmp[1024]; - int curses_flags = (F_ENABLE_CONSOLE | F_ENABLE_SERIAL); /* Return bit mask for clearing color pair number if given ch has color */ diff --git a/payloads/libpayload/drivers/nvram.c b/payloads/libpayload/drivers/nvram.c index 40bd2fc882..4794e9b249 100644 --- a/payloads/libpayload/drivers/nvram.c +++ b/payloads/libpayload/drivers/nvram.c @@ -42,7 +42,6 @@ #include <libpayload-config.h> #include <libpayload.h> - /** * PCs can have either 64 (very old ones), 128, or 256 bytes of CMOS RAM. * diff --git a/payloads/libpayload/drivers/serial/qcom_qupv3_serial.c b/payloads/libpayload/drivers/serial/qcom_qupv3_serial.c index 321ff46b42..77def46831 100644 --- a/payloads/libpayload/drivers/serial/qcom_qupv3_serial.c +++ b/payloads/libpayload/drivers/serial/qcom_qupv3_serial.c @@ -27,7 +27,6 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - /* For simplicity sake let's rely on coreboot initializing the UART. */ #include <config.h> #include <libpayload.h> diff --git a/payloads/libpayload/drivers/storage/ahci.c b/payloads/libpayload/drivers/storage/ahci.c index 9f9b9b589a..ff22b19b71 100644 --- a/payloads/libpayload/drivers/storage/ahci.c +++ b/payloads/libpayload/drivers/storage/ahci.c @@ -39,7 +39,6 @@ #include "ahci_private.h" - #ifdef DEBUG_STATUS static inline u32 _ahci_clear_status(volatile u32 *const reg, const char *const r, @@ -64,7 +63,6 @@ static inline u32 _ahci_clear_status(volatile u32 *const reg) #define ahci_clear_status(p, r) _ahci_clear_status(&(p)->r) #endif - static inline int ahci_port_is_active(const hba_port_t *const port) { return (port->sata_status & (HBA_PxSSTS_IPM_MASK | HBA_PxSSTS_DET_MASK)) diff --git a/payloads/libpayload/drivers/storage/ahci_ata.c b/payloads/libpayload/drivers/storage/ahci_ata.c index 514692e39f..062b7ac71b 100644 --- a/payloads/libpayload/drivers/storage/ahci_ata.c +++ b/payloads/libpayload/drivers/storage/ahci_ata.c @@ -37,7 +37,6 @@ #include "ahci_private.h" - ssize_t ahci_ata_read_sectors(ata_dev_t *const ata_dev, const lba_t start, size_t count, u8 *const buf) diff --git a/payloads/libpayload/drivers/storage/ahci_atapi.c b/payloads/libpayload/drivers/storage/ahci_atapi.c index 9984b4b78d..1a757d7e9b 100644 --- a/payloads/libpayload/drivers/storage/ahci_atapi.c +++ b/payloads/libpayload/drivers/storage/ahci_atapi.c @@ -35,10 +35,8 @@ #include <storage/ata.h> #include <storage/ahci.h> - #include "ahci_private.h" - ssize_t ahci_packet_read_cmd(atapi_dev_t *const _dev, const u8 *const cmd, const size_t cmdlen, u8 *const buf, const size_t buflen) diff --git a/payloads/libpayload/drivers/storage/ahci_common.c b/payloads/libpayload/drivers/storage/ahci_common.c index b8fdad202c..f3abc5f7fb 100644 --- a/payloads/libpayload/drivers/storage/ahci_common.c +++ b/payloads/libpayload/drivers/storage/ahci_common.c @@ -37,7 +37,6 @@ #include "ahci_private.h" - #ifdef DEBUG_STATUS static inline u32 _ahci_clear_status(volatile u32 *const reg, const char *const r, @@ -62,7 +61,6 @@ static inline u32 _ahci_clear_status(volatile u32 *const reg) #define ahci_clear_status(p, r) _ahci_clear_status(&(p)->r) #endif - /** Give a buffer with even address. */ static u8 *ahci_prdbuf_init(ahci_dev_t *const dev, u8 *const user_buf, const size_t len, diff --git a/payloads/libpayload/drivers/storage/ahci_private.h b/payloads/libpayload/drivers/storage/ahci_private.h index 7f7c592048..1e8c85f199 100644 --- a/payloads/libpayload/drivers/storage/ahci_private.h +++ b/payloads/libpayload/drivers/storage/ahci_private.h @@ -120,7 +120,6 @@ typedef volatile struct { #define HBA_CTRL_INTR_EN (1 << 1) #define HBA_CTRL_RESET (1 << 0) - typedef volatile struct { u8 dma_setup_fis[28]; u8 _reserved0[4]; @@ -229,5 +228,4 @@ ssize_t ahci_ata_read_sectors(ata_dev_t *const ata_dev, const lba_t start, size_t count, u8 *const buf); - #endif /* _AHCI_PRIVATE_H */ diff --git a/payloads/libpayload/drivers/storage/ata.c b/payloads/libpayload/drivers/storage/ata.c index 68f88f6eb7..00f1d88854 100644 --- a/payloads/libpayload/drivers/storage/ata.c +++ b/payloads/libpayload/drivers/storage/ata.c @@ -33,7 +33,6 @@ #include <storage/ata.h> - /** Reads non-sector-aligned blocks of 512 bytes. */ static ssize_t ata_read_unaligned(ata_dev_t *const dev, const lba_t blk_start, size_t blk_count, diff --git a/payloads/libpayload/drivers/storage/atapi.c b/payloads/libpayload/drivers/storage/atapi.c index f42c1f4b80..7f46e9cc3e 100644 --- a/payloads/libpayload/drivers/storage/atapi.c +++ b/payloads/libpayload/drivers/storage/atapi.c @@ -33,7 +33,6 @@ #include <storage/ata.h> #include <storage/atapi.h> - static int atapi_request_sense(atapi_dev_t *const dev) { u8 cdb[12] = { 0, }; diff --git a/payloads/libpayload/drivers/storage/storage.c b/payloads/libpayload/drivers/storage/storage.c index 3ddafdce07..24b9024a93 100644 --- a/payloads/libpayload/drivers/storage/storage.c +++ b/payloads/libpayload/drivers/storage/storage.c @@ -32,7 +32,6 @@ #endif #include <storage/storage.h> - static storage_dev_t **devices = NULL; static size_t devices_length = 0; static size_t dev_count = 0; diff --git a/payloads/libpayload/drivers/udc/chipidea.c b/payloads/libpayload/drivers/udc/chipidea.c index dd1601367b..3df7d2409c 100644 --- a/payloads/libpayload/drivers/udc/chipidea.c +++ b/payloads/libpayload/drivers/udc/chipidea.c @@ -300,7 +300,6 @@ static void start_setup(struct usbdev_ctrl *this, int ep) udc_handle_setup(this, ep, &dr); } - static void chipidea_enqueue_packet(struct usbdev_ctrl *this, int endpoint, int in_dir, void *data, int len, int zlp, int autofree) { diff --git a/payloads/libpayload/drivers/usb/dwc2_rh.c b/payloads/libpayload/drivers/usb/dwc2_rh.c index ff15e9902d..c0f25f907a 100644 --- a/payloads/libpayload/drivers/usb/dwc2_rh.c +++ b/payloads/libpayload/drivers/usb/dwc2_rh.c @@ -12,7 +12,6 @@ * GNU General Public License for more details. */ - #include <usb/usb.h> #include "generic_hub.h" #include "dwc2_private.h" diff --git a/payloads/libpayload/drivers/usb/ehci.c b/payloads/libpayload/drivers/usb/ehci.c index cb3c1c543e..97caf202d9 100644 --- a/payloads/libpayload/drivers/usb/ehci.c +++ b/payloads/libpayload/drivers/usb/ehci.c @@ -426,7 +426,6 @@ oom: return -1; } - /* FIXME: Handle control transfers as 3 QHs, so the 2nd stage can be >0x4000 bytes */ static int ehci_control (usbdev_t *dev, direction_t dir, int drlen, void *setup, int dalen, u8 *src) @@ -544,7 +543,6 @@ oom: return -1; } - typedef struct _intr_qtd_t intr_qtd_t; struct _intr_qtd_t { diff --git a/payloads/libpayload/drivers/usb/ehci_rh.c b/payloads/libpayload/drivers/usb/ehci_rh.c index e51f332822..edb1b4ad4d 100644 --- a/payloads/libpayload/drivers/usb/ehci_rh.c +++ b/payloads/libpayload/drivers/usb/ehci_rh.c @@ -171,7 +171,6 @@ ehci_rh_poll (usbdev_t *dev) ehci_rh_scanport (dev, port); } - void ehci_rh_init (usbdev_t *dev) { diff --git a/payloads/libpayload/drivers/usb/ohci.c b/payloads/libpayload/drivers/usb/ohci.c index 87674eec6b..ec14144711 100644 --- a/payloads/libpayload/drivers/usb/ohci.c +++ b/payloads/libpayload/drivers/usb/ohci.c @@ -627,7 +627,6 @@ ohci_bulk (endpoint_t *ep, int dalen, u8 *src, int finalize) return result; } - struct _intr_queue; struct _intrq_td { diff --git a/payloads/libpayload/drivers/usb/usbhid.c b/payloads/libpayload/drivers/usb/usbhid.c index 921e17608e..87e87411fe 100644 --- a/payloads/libpayload/drivers/usb/usbhid.c +++ b/payloads/libpayload/drivers/usb/usbhid.c @@ -131,8 +131,6 @@ const char *countries[36][2] = { /* 36 - 255: Reserved */ }; - - struct layout_maps { const char *country; const short map[4][0x80]; @@ -247,7 +245,6 @@ static const struct layout_maps keyboard_layouts[] = { //#endif }; - static void usb_hid_keyboard_queue(int ch) { /* ignore key presses if buffer full */ if (keycount < KEYBOARD_BUFFER_SIZE) @@ -316,7 +313,6 @@ usb_hid_process_keyboard_event(usbhid_inst_t *const inst, if (skip) continue; - /* Mask off KB_MOD_CTRL */ keypress = map->map[modifiers & 0x03][current->keys[i]]; @@ -397,7 +393,6 @@ static struct console_input_driver cons = { .input_type = CONSOLE_INPUT_TYPE_USB, }; - static int usb_hid_set_layout (const char *country) { /* FIXME should be per keyboard */ diff --git a/payloads/libpayload/drivers/usb/usbmsc.c b/payloads/libpayload/drivers/usb/usbmsc.c index ed91c9938b..96c4946b76 100755 --- a/payloads/libpayload/drivers/usb/usbmsc.c +++ b/payloads/libpayload/drivers/usb/usbmsc.c @@ -613,7 +613,6 @@ usb_msc_init (usbdev_t *dev) usb_debug (" it uses %s protocol\n", msc_protocol_strings[interface->bInterfaceProtocol]); - if (interface->bInterfaceProtocol != 0x50) { usb_debug (" Protocol not supported.\n"); usb_detach_device (dev->controller, dev->address); diff --git a/payloads/libpayload/drivers/usb/xhci_private.h b/payloads/libpayload/drivers/usb/xhci_private.h index 137c88e0b9..34d3651daf 100644 --- a/payloads/libpayload/drivers/usb/xhci_private.h +++ b/payloads/libpayload/drivers/usb/xhci_private.h @@ -515,7 +515,6 @@ static inline int xhci_ep_id(const endpoint_t *const ep) { return ((ep->endpoint & 0x7f) * 2) + (ep->direction != OUT); } - #ifdef XHCI_DUMPS void xhci_dump_slotctx(const slotctx_t *); void xhci_dump_epctx(const epctx_t *); diff --git a/payloads/libpayload/drivers/usb/xhci_rh.c b/payloads/libpayload/drivers/usb/xhci_rh.c index 9b711c8586..bf4c2bc5c1 100644 --- a/payloads/libpayload/drivers/usb/xhci_rh.c +++ b/payloads/libpayload/drivers/usb/xhci_rh.c @@ -135,7 +135,6 @@ xhci_rh_enable_port(usbdev_t *const dev, int port) return 0; } - static const generic_hub_ops_t xhci_rh_ops = { .hub_status_changed = xhci_rh_hub_status_changed, .port_status_changed = xhci_rh_port_status_changed, diff --git a/payloads/libpayload/drivers/video/corebootfb.c b/payloads/libpayload/drivers/video/corebootfb.c index 1865ad37bf..51922d9b06 100644 --- a/payloads/libpayload/drivers/video/corebootfb.c +++ b/payloads/libpayload/drivers/video/corebootfb.c @@ -138,7 +138,6 @@ static void corebootfb_putchar(u8 row, u8 col, unsigned int ch) ((((vga_colors[fg] >> 16) & 0xff) >> (8 - fbinfo.red_mask_size)) << fbinfo.red_mask_pos); } - dst = FB + ((row * font_height) * fbinfo.bytes_per_line); dst += (col * font_width * (fbinfo.bits_per_pixel >> 3)); diff --git a/payloads/libpayload/drivers/video/geodelx.c b/payloads/libpayload/drivers/video/geodelx.c index 7c51fc21e6..8799bca669 100644 --- a/payloads/libpayload/drivers/video/geodelx.c +++ b/payloads/libpayload/drivers/video/geodelx.c @@ -176,7 +176,6 @@ static void init_video_mode(void) writel(((vga_mode.hactive - 1) << 16) | (vga_mode.vactive - 1), DC + 0x5C); - /* Write the VG configuration */ writel(0x290000F | vga_mode.synccfg, VG + 0x08); diff --git a/payloads/libpayload/include/ctype.h b/payloads/libpayload/include/ctype.h index c1ca698e1c..98cb306180 100644 --- a/payloads/libpayload/include/ctype.h +++ b/payloads/libpayload/include/ctype.h @@ -50,5 +50,4 @@ int tolower(int c); int toupper(int c); /** @} */ - #endif diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h index 25080d85ed..01d71b8e61 100644 --- a/payloads/libpayload/include/libpayload.h +++ b/payloads/libpayload/include/libpayload.h @@ -456,7 +456,6 @@ static inline int log2(u32 x) { return (int)sizeof(x) * 8 - clz(x) - 1; } static inline int __ffs(u32 x) { return log2(x & (u32)(-(s32)x)); } /** @} */ - /** * @defgroup mmio MMIO helper functions * @{ @@ -475,7 +474,6 @@ static inline void buffer_to_fifo32(void *buffer, size_t size, void *fifo, #endif /** @} */ - /** * @defgroup hash Hashing functions * @{ diff --git a/payloads/libpayload/include/queue.h b/payloads/libpayload/include/queue.h index 7d579a7bc4..c9ac701987 100644 --- a/payloads/libpayload/include/queue.h +++ b/payloads/libpayload/include/queue.h @@ -344,7 +344,6 @@ struct { \ #define XSIMPLEQ_EMPTY(head) (XSIMPLEQ_FIRST(head) == XSIMPLEQ_END(head)) #define XSIMPLEQ_NEXT(head, elm, field) XSIMPLEQ_XOR(head, ((elm)->field.sqx_next)) - #define XSIMPLEQ_FOREACH(var, head, field) \ for ((var) = XSIMPLEQ_FIRST(head); \ (var) != XSIMPLEQ_END(head); \ @@ -398,7 +397,6 @@ struct { \ XSIMPLEQ_XOR(head, &(elm)->field.sqx_next); \ } while (0) - /* * Tail queue definitions. */ @@ -442,7 +440,6 @@ struct { \ ((tvar) = TAILQ_NEXT(var, field), 1); \ (var) = (tvar)) - #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ for((var) = TAILQ_LAST(head, headname); \ (var) != TAILQ_END(head); \ diff --git a/payloads/libpayload/include/storage/ata.h b/payloads/libpayload/include/storage/ata.h index 39937dbe34..43249e7513 100644 --- a/payloads/libpayload/include/storage/ata.h +++ b/payloads/libpayload/include/storage/ata.h @@ -33,7 +33,6 @@ #include "storage.h" - /* ATA commands */ enum { ATA_READ_DMA = 0xc8, diff --git a/payloads/libpayload/include/storage/atapi.h b/payloads/libpayload/include/storage/atapi.h index eea5c332f8..5a6e244032 100644 --- a/payloads/libpayload/include/storage/atapi.h +++ b/payloads/libpayload/include/storage/atapi.h @@ -34,7 +34,6 @@ #include "storage.h" #include "ata.h" - /* ATAPI commands */ enum { ATAPI_TEST_UNIT_READY = 0x00, diff --git a/payloads/libpayload/include/storage/storage.h b/payloads/libpayload/include/storage/storage.h index 7a2a84bef7..32933fd97c 100644 --- a/payloads/libpayload/include/storage/storage.h +++ b/payloads/libpayload/include/storage/storage.h @@ -32,14 +32,12 @@ #include <stdint.h> #include <unistd.h> - #if !CONFIG(LP_STORAGE_64BIT_LBA) typedef u32 lba_t; #else typedef u64 lba_t; #endif - typedef enum { PORT_TYPE_IDE = (1 << 0), PORT_TYPE_SATA = (1 << 1), @@ -54,7 +52,6 @@ typedef enum { POLL_MEDIUM_PRESENT = 1, } storage_poll_t; - struct storage_dev; typedef struct storage_dev { @@ -70,7 +67,6 @@ typedef struct storage_dev { int storage_device_count(void); int storage_attach_device(storage_dev_t *dev); - storage_poll_t storage_probe(size_t dev_num); ssize_t storage_read_blocks512(size_t dev_num, lba_t start, size_t count, unsigned char *buf); diff --git a/payloads/libpayload/include/string.h b/payloads/libpayload/include/string.h index ca263e4410..393881d9cc 100644 --- a/payloads/libpayload/include/string.h +++ b/payloads/libpayload/include/string.h @@ -83,5 +83,4 @@ size_t strlcpy(char *d, const char *s, size_t n); size_t strlcat(char *d, const char *s, size_t n); /** @} */ - #endif diff --git a/payloads/libpayload/libc/memory.c b/payloads/libpayload/libc/memory.c index cc33eab686..fff295e54c 100644 --- a/payloads/libpayload/libc/memory.c +++ b/payloads/libpayload/libc/memory.c @@ -145,7 +145,6 @@ static int default_memcmp(const void *s1, const void *s2, size_t n) int memcmp(const void *s1, const void *s2, size_t n) __attribute__((weak, alias("default_memcmp"))); - void *memchr(const void *s, int c, size_t n) { unsigned char *p = (unsigned char *)s; diff --git a/payloads/libpayload/libc/string.c b/payloads/libpayload/libc/string.c index a481fef7eb..46c3c019bd 100644 --- a/payloads/libpayload/libc/string.c +++ b/payloads/libpayload/libc/string.c @@ -521,7 +521,6 @@ unsigned long int strtoul(const char *ptr, char **endptr, int base) return val; } - /** * Determine the number of leading characters in s that match characters in a * @param s A pointer to the string to analyse diff --git a/payloads/libpayload/liblzma/lzmadecode.c b/payloads/libpayload/liblzma/lzmadecode.c index 1cf647d27b..c8115d308a 100644 --- a/payloads/libpayload/liblzma/lzmadecode.c +++ b/payloads/libpayload/liblzma/lzmadecode.c @@ -33,12 +33,10 @@ #define RC_INIT2 Code = 0; Range = 0xFFFFFFFF; \ { int i; for(i = 0; i < 5; i++) { RC_TEST; Code = (Code << 8) | RC_READ_BYTE; }} - #define RC_TEST { if (Buffer == BufferLim) return LZMA_RESULT_DATA_ERROR; } #define RC_INIT(buffer, bufferSize) Buffer = buffer; BufferLim = buffer + bufferSize; RC_INIT2 - #define RC_NORMALIZE if (Range < kTopValue) { RC_TEST; Range <<= 8; Code = (Code << 8) | RC_READ_BYTE; } #define IfBit0(p) RC_NORMALIZE; bound = (Range >> kNumBitModelTotalBits) * *(p); if (Code < bound) @@ -56,7 +54,6 @@ do { CProb *cp = probs + res; RC_GET_BIT(cp, res) } while(--i != 0); \ res -= (1 << numLevels); } - #define kNumPosBitsMax 4 #define kNumPosStatesMax (1 << kNumPosBitsMax) @@ -74,7 +71,6 @@ #define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits)) #define kNumLenProbs (LenHigh + kLenNumHighSymbols) - #define kNumStates 12 #define kNumLitStates 7 @@ -143,7 +139,6 @@ int LzmaDecode(CLzmaDecoderState *vs, UInt32 literalPosMask = (1 << (vs->Properties.lp)) - 1; int lc = vs->Properties.lc; - int state = 0; UInt32 rep0 = 1, rep1 = 1, rep2 = 1, rep3 = 1; int len = 0; @@ -164,7 +159,6 @@ int LzmaDecode(CLzmaDecoderState *vs, RC_INIT(inStream, inSize); - while(nowPos < outSize) { CProb *prob; @@ -379,7 +373,6 @@ int LzmaDecode(CLzmaDecoderState *vs, if (rep0 > nowPos) return LZMA_RESULT_DATA_ERROR; - do { previousByte = outStream[nowPos - rep0]; @@ -391,7 +384,6 @@ int LzmaDecode(CLzmaDecoderState *vs, } RC_NORMALIZE; - *inSizeProcessed = (SizeT)(Buffer - inStream); *outSizeProcessed = nowPos; return LZMA_RESULT_OK; diff --git a/payloads/libpayload/liblzma/lzmadecode.h b/payloads/libpayload/liblzma/lzmadecode.h index 34c9f14c33..05ff0a3397 100644 --- a/payloads/libpayload/liblzma/lzmadecode.h +++ b/payloads/libpayload/liblzma/lzmadecode.h @@ -32,7 +32,6 @@ typedef UInt32 SizeT; #define LZMA_RESULT_OK 0 #define LZMA_RESULT_DATA_ERROR 1 - #define LZMA_BASE_SIZE 1846 #define LZMA_LIT_SIZE 768 @@ -56,10 +55,8 @@ typedef struct _CLzmaDecoderState CLzmaProperties Properties; CProb *Probs; - } CLzmaDecoderState; - int LzmaDecode(CLzmaDecoderState *vs, const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed, unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed); |