aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firmware-utils/src/mkcsysimg.c
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2021-04-09 10:43:07 +0200
committerRafał Miłecki <rafal@milecki.pl>2021-04-09 11:05:54 +0200
commit69e9138080ae39236de48561cf8923a86104eb35 (patch)
treead605c6a312bcfd159bc6256fe17839826228919 /tools/firmware-utils/src/mkcsysimg.c
parent052a30d65e90ac9b3359f4a23aa3024d102c178c (diff)
downloadupstream-69e9138080ae39236de48561cf8923a86104eb35.tar.gz
upstream-69e9138080ae39236de48561cf8923a86104eb35.tar.bz2
upstream-69e9138080ae39236de48561cf8923a86104eb35.zip
firmware-utils: fix -Wpointer-sign warnings
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'tools/firmware-utils/src/mkcsysimg.c')
-rw-r--r--tools/firmware-utils/src/mkcsysimg.c15
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;