mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 02:35:28 +00:00
Make all warnings into errors.
Also fix a couple places where that makes it fail. BUG=none TEST=none Change-Id: I3b434b4bfa547a579193aac67c1a9d440a2c4e51
This commit is contained in:
@@ -17,7 +17,7 @@ OBJDUMP=$(CROSS_COMPILE)objdump
|
||||
BUILDCC?=gcc
|
||||
HOSTCC?=$(HOST_CROSS_COMPILE)gcc
|
||||
|
||||
CFLAGS_WARN=-Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
|
||||
CFLAGS_WARN=-Wall -Werror -Wundef -Wstrict-prototypes -Wno-trigraphs \
|
||||
-fno-strict-aliasing -fno-common \
|
||||
-Werror-implicit-function-declaration -Wno-format-security \
|
||||
-fno-delete-null-pointer-checks -Wdeclaration-after-statement \
|
||||
|
||||
@@ -188,7 +188,7 @@ static int find_last_wp_block(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int get_wp_range(int *start, int *nblock)
|
||||
static int get_wp_range(uint32_t *start, uint32_t *nblock)
|
||||
{
|
||||
int start_blk, end_blk;
|
||||
|
||||
@@ -204,8 +204,8 @@ static int get_wp_range(int *start, int *nblock)
|
||||
/* TODO: Sanity check the shadow value? */
|
||||
|
||||
end_blk = find_last_wp_block();
|
||||
*nblock = end_blk - start_blk + 1;
|
||||
*start = start_blk;
|
||||
*nblock = (uint32_t)(end_blk - start_blk + 1);
|
||||
*start = (uint32_t)start_blk;
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -225,9 +225,9 @@ static int set_wp_range(int start, int nblock)
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
int flash_get_write_protect_range(int *offset, int *size)
|
||||
int flash_get_write_protect_range(uint32_t *offset, uint32_t *size)
|
||||
{
|
||||
int start, nblock;
|
||||
uint32_t start, nblock;
|
||||
int rv;
|
||||
|
||||
rv = get_wp_range(&start, &nblock);
|
||||
@@ -239,13 +239,12 @@ int flash_get_write_protect_range(int *offset, int *size)
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
int flash_set_write_protect_range(int offset, int size)
|
||||
int flash_set_write_protect_range(uint32_t offset, uint32_t size)
|
||||
{
|
||||
int start, nblock;
|
||||
int rv;
|
||||
|
||||
if ((offset < 0) || (size < 0) || ((offset + size) >
|
||||
(LM4_FLASH_FSIZE * FLASH_PROTECT_BYTES)))
|
||||
if ((offset + size) > (LM4_FLASH_FSIZE * FLASH_PROTECT_BYTES))
|
||||
return EC_ERROR_UNKNOWN; /* Invalid range */
|
||||
|
||||
rv = flash_get_write_protect_status();
|
||||
@@ -272,7 +271,7 @@ int flash_set_write_protect_range(int offset, int size)
|
||||
|
||||
int flash_get_write_protect_status(void)
|
||||
{
|
||||
int start, nblock;
|
||||
uint32_t start, nblock;
|
||||
int rv;
|
||||
|
||||
rv = get_wp_range(&start, &nblock);
|
||||
|
||||
@@ -151,7 +151,7 @@ DECLARE_CONSOLE_COMMAND(flashwp, command_flash_wp);
|
||||
|
||||
static int command_flash_wp_range(int argc, char **argv)
|
||||
{
|
||||
int offset, size;
|
||||
uint32_t offset, size;
|
||||
char *endptr;
|
||||
int rv;
|
||||
|
||||
@@ -167,12 +167,12 @@ static int command_flash_wp_range(int argc, char **argv)
|
||||
LM4_FLASH_FMPPE0, LM4_FLASH_FMPPE1,
|
||||
LM4_FLASH_FMPPE2, LM4_FLASH_FMPPE3);
|
||||
} else {
|
||||
offset = strtoi(argv[1], &endptr, 0);
|
||||
offset = (uint32_t)strtoi(argv[1], &endptr, 0);
|
||||
if (*endptr) {
|
||||
uart_printf("Invalid offset \"%s\"\n", argv[1]);
|
||||
return EC_ERROR_UNKNOWN;
|
||||
}
|
||||
size = strtoi(argv[2], &endptr, 0);
|
||||
size = (uint32_t)strtoi(argv[2], &endptr, 0);
|
||||
if (*endptr) {
|
||||
uart_printf("Invalid size \"%s\"\n", argv[2]);
|
||||
return EC_ERROR_UNKNOWN;
|
||||
|
||||
@@ -68,8 +68,8 @@ int flash_erase(int offset, int size);
|
||||
* the write protect range is also locked, and may not be subsequently
|
||||
* altered until after a cold boot with the write protect pin
|
||||
* deasserted. */
|
||||
int flash_get_write_protect_range(int *offset, int *size);
|
||||
int flash_set_write_protect_range(int offset, int size);
|
||||
int flash_get_write_protect_range(uint32_t *offset, uint32_t *size);
|
||||
int flash_set_write_protect_range(uint32_t offset, uint32_t size);
|
||||
|
||||
/* The write protect range has been stored into the chip registers
|
||||
* this boot. The flash is write protected and the range cannot be
|
||||
|
||||
Reference in New Issue
Block a user