diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2021-01-27 19:38:12 +1100 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2021-02-12 13:46:16 +1100 |
commit | 09b201101478e6e1c858fc4ef4f859d88a2b8a49 (patch) | |
tree | 63901b0e011789804bc781cb87890f2aeb5d6db5 /lib/libnvram/nvram.c | |
parent | 73cb04d7df4eec3ae294e90d85b8b436a9bf1846 (diff) | |
download | SLOF-09b201101478e6e1c858fc4ef4f859d88a2b8a49.zip SLOF-09b201101478e6e1c858fc4ef4f859d88a2b8a49.tar.gz SLOF-09b201101478e6e1c858fc4ef4f859d88a2b8a49.tar.bz2 |
libnvram: Compile with -Wextra
-Wextra enables a bunch of rather useful checks which this fixes.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'lib/libnvram/nvram.c')
-rw-r--r-- | lib/libnvram/nvram.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/libnvram/nvram.c b/lib/libnvram/nvram.c index 99deb2a..6d145d7 100644 --- a/lib/libnvram/nvram.c +++ b/lib/libnvram/nvram.c @@ -163,7 +163,7 @@ nvram_access(uint64_t, 64, qword) * @return pointer to temporary buffer */ -char *get_nvram_buffer(int len) +char *get_nvram_buffer(unsigned len) { if(len>NVRAM_LENGTH) return NULL; @@ -271,7 +271,7 @@ static uint8_t calc_partition_header_checksum(int offset) static int calc_used_nvram_space(void) { - int walk, len; + unsigned walk, len; for (walk=0; walk<NVRAM_LENGTH;) { if(nvram_read_byte(walk) == 0 @@ -319,7 +319,7 @@ static int calc_used_nvram_space(void) partition_t get_partition(unsigned int type, char *name) { partition_t ret={0,-1}; - int walk, len; + unsigned walk, len; DEBUG("get_partition(%i, '%s')\n", type, name); @@ -416,11 +416,10 @@ int wipe_partition(partition_t partition, int header_only) } -static partition_t create_nvram_partition(int type, const char *name, int len) +static partition_t create_nvram_partition(int type, const char *name, unsigned len) { partition_t ret = { 0, 0 }; - int offset, plen; - unsigned int i; + unsigned i, offset, plen; plen = ALIGN(len+PARTITION_HEADER_SIZE, 16); @@ -510,7 +509,7 @@ partition_t new_nvram_partition_fs(int type, char *name, int namelen, int len) int delete_nvram_partition(partition_t partition) { - int i; + unsigned i; partition_t free_part; if(!partition.len || partition.len == -1) |