diff options
author | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2011-11-23 09:13:48 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2011-11-23 09:13:48 +0000 |
commit | 0370ade2e7631053b15ca2d6cfc0c7ee2bd5613a (patch) | |
tree | 2ea0b12abf9dd3483246423752239b88c6d7942e /flashrom.c | |
parent | 74ae890f7ceda635fb1bbab899f6e3a4898800be (diff) | |
download | flashrom-0370ade2e7631053b15ca2d6cfc0c7ee2bd5613a.zip flashrom-0370ade2e7631053b15ca2d6cfc0c7ee2bd5613a.tar.gz |
Unsignify lengths and addresses in chip functions and structs
Push those changes forward where needed to prevent new sign
conversion warnings where possible.
Corresponding to flashrom svn r1470.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'flashrom.c')
-rw-r--r-- | flashrom.c | 27 |
1 files changed, 15 insertions, 12 deletions
@@ -412,7 +412,7 @@ void map_flash_registers(struct flashchip *flash) flash->virtual_registers = (chipaddr)programmer_map_flash_region("flash chip registers", (0xFFFFFFFF - 0x400000 - size + 1), size); } -int read_memmapped(struct flashchip *flash, uint8_t *buf, int start, int len) +int read_memmapped(struct flashchip *flash, uint8_t *buf, unsigned int start, int unsigned len) { chip_readn(buf, flash->virtual_memory + start, len); @@ -535,7 +535,7 @@ static unsigned int count_usable_erasers(const struct flashchip *flash) } /* start is an offset to the base address of the flash chip */ -int check_erased_range(struct flashchip *flash, int start, int len) +int check_erased_range(struct flashchip *flash, unsigned int start, unsigned int len) { int ret; uint8_t *cmpbuf = malloc(len); @@ -558,10 +558,10 @@ int check_erased_range(struct flashchip *flash, int start, int len) * @message string to print in the "FAILED" message * @return 0 for success, -1 for failure */ -int verify_range(struct flashchip *flash, uint8_t *cmpbuf, int start, int len, +int verify_range(struct flashchip *flash, uint8_t *cmpbuf, unsigned int start, unsigned int len, const char *message) { - int i; + unsigned int i; uint8_t *readbuf = malloc(len); int ret = 0, failcount = 0; @@ -639,10 +639,10 @@ out_free: * @gran write granularity (enum, not count) * @return 0 if no erase is needed, 1 otherwise */ -int need_erase(uint8_t *have, uint8_t *want, int len, enum write_granularity gran) +int need_erase(uint8_t *have, uint8_t *want, unsigned int len, enum write_granularity gran) { int result = 0; - int i, j, limit; + unsigned int i, j, limit; switch (gran) { case write_gran_1bit: @@ -705,11 +705,13 @@ int need_erase(uint8_t *have, uint8_t *want, int len, enum write_granularity gra * in relation to the max write length of the programmer and the max write * length of the chip. */ -static int get_next_write(uint8_t *have, uint8_t *want, int len, - int *first_start, enum write_granularity gran) +static unsigned int get_next_write(uint8_t *have, uint8_t *want, unsigned int len, + unsigned int *first_start, + enum write_granularity gran) { - int need_write = 0, rel_start = 0, first_len = 0; - int i, limit, stride; + int need_write = 0; + unsigned int rel_start = 0, first_len = 0; + unsigned int i, limit, stride; switch (gran) { case write_gran_1bit: @@ -1030,7 +1032,7 @@ notfound: int verify_flash(struct flashchip *flash, uint8_t *buf) { int ret; - int total_size = flash->total_size * 1024; + unsigned int total_size = flash->total_size * 1024; msg_cinfo("Verifying flash... "); @@ -1208,7 +1210,8 @@ static int erase_and_write_block_helper(struct flashchip *flash, unsigned int addr, unsigned int len)) { - int starthere = 0, lenhere = 0, ret = 0, skip = 1, writecount = 0; + unsigned int starthere = 0, lenhere = 0; + int ret = 0, skip = 1, writecount = 0; enum write_granularity gran = write_gran_256bytes; /* FIXME */ /* curcontents and newcontents are opaque to walk_eraseregions, and |