diff options
Diffstat (limited to 'tools/firmware-utils/src/mkcsysimg.c')
-rw-r--r-- | tools/firmware-utils/src/mkcsysimg.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/firmware-utils/src/mkcsysimg.c b/tools/firmware-utils/src/mkcsysimg.c index e156f79153..0ddb54c4ec 100644 --- a/tools/firmware-utils/src/mkcsysimg.c +++ b/tools/firmware-utils/src/mkcsysimg.c @@ -423,8 +423,9 @@ csum8_get(struct csum_state *css) void -csum16_update(uint8_t *p, uint32_t len, struct csum_state *css) +csum16_update(void *data, uint32_t len, struct csum_state *css) { + uint8_t *p = data; uint16_t t; if (css->odd) { @@ -468,8 +469,10 @@ csum_init(struct csum_state *css, int size) void -csum_update(uint8_t *p, uint32_t len, struct csum_state *css) +csum_update(void *data, uint32_t len, struct csum_state *css) { + uint8_t *p = data; + switch (css->size) { case CSUM_SIZE_8: csum8_update(p,len,css); @@ -506,19 +509,21 @@ csum_get(struct csum_state *css) * routines to write data to the output file */ int -write_out_data(FILE *outfile, uint8_t *data, size_t len, +write_out_data(FILE *outfile, void *data, size_t len, struct csum_state *css) { + uint8_t *ptr = data; + errno = 0; - fwrite(data, len, 1, outfile); + fwrite(ptr, len, 1, outfile); if (errno) { ERRS("unable to write output file"); return ERR_FATAL; } if (css) { - csum_update(data, len, css); + csum_update(ptr, len, css); } return 0; |