From: Rafał Miłecki Date: Fri, 9 Apr 2021 06:52:03 +0000 (+0200) Subject: firmware-utils: fix few random warnings X-Git-Tag: v22.03.0-rc1~2850 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=a2f66229450dc2f7647c19ac83f3948e809406c2;p=openwrt%2Fopenwrt.git firmware-utils: fix few random warnings 1. -Wunused-label 2. -Wparentheses 3. -Wmisleading-indentation 4. -Wformat-overflow Signed-off-by: Rafał Miłecki --- diff --git a/tools/firmware-utils/src/dgn3500sum.c b/tools/firmware-utils/src/dgn3500sum.c index eb80e6c01b..e86621bc1f 100644 --- a/tools/firmware-utils/src/dgn3500sum.c +++ b/tools/firmware-utils/src/dgn3500sum.c @@ -104,7 +104,7 @@ int main(int argc, char** argv) char *endptr, *buffer, *p; int count; // size of file in bytes unsigned short sum = 0, sum1 = 0; - char sumbuf[9]; + char sumbuf[8 + 8 + 1]; if(argc < 3) { printf("ERROR: Argument missing!\n\nUsage %s filename starting offset in hex [PID code]\n\n", argv[0]); diff --git a/tools/firmware-utils/src/mkdniimg.c b/tools/firmware-utils/src/mkdniimg.c index 9111d3434b..92315f9849 100644 --- a/tools/firmware-utils/src/mkdniimg.c +++ b/tools/firmware-utils/src/mkdniimg.c @@ -187,7 +187,6 @@ int main(int argc, char *argv[]) res = EXIT_SUCCESS; - out_flush: fflush(outfile); err_close_out: diff --git a/tools/firmware-utils/src/mkmylofw.c b/tools/firmware-utils/src/mkmylofw.c index 3ad743420f..c049ce436e 100644 --- a/tools/firmware-utils/src/mkmylofw.c +++ b/tools/firmware-utils/src/mkmylofw.c @@ -98,7 +98,7 @@ struct cpx_board { #define CPX_BOARD_AR23XX(_did, _flash, _mod, _name, _desc) \ CPX_BOARD(_did, _flash, _mod, _name, _desc, 0x10000, 0x10000) -#define ALIGN(x,y) ((x)+((y)-1)) & ~((y)-1) +#define ALIGN(x,y) (((x)+((y)-1)) & ~((y)-1)) char *progname; char *ofname = NULL; diff --git a/tools/firmware-utils/src/mkplanexfw.c b/tools/firmware-utils/src/mkplanexfw.c index 52145e63d6..0230fe2252 100644 --- a/tools/firmware-utils/src/mkplanexfw.c +++ b/tools/firmware-utils/src/mkplanexfw.c @@ -247,7 +247,6 @@ int main(int argc, char *argv[]) res = EXIT_SUCCESS; - out_flush: fflush(outfile); err_close_out: diff --git a/tools/firmware-utils/src/mktitanimg.c b/tools/firmware-utils/src/mktitanimg.c index 6f2b27a1f6..acc21bd64d 100644 --- a/tools/firmware-utils/src/mktitanimg.c +++ b/tools/firmware-utils/src/mktitanimg.c @@ -284,7 +284,7 @@ int main(int argc, char* argv[], char* env[]) else padding = align - ((section->raw_size+ section->offset) % align); - section->total_size=section->raw_size + padding; + section->total_size=section->raw_size + padding; } else{ #define EXTRA_BLOCK 0x10000 diff --git a/tools/firmware-utils/src/osbridge-crc.c b/tools/firmware-utils/src/osbridge-crc.c index 519dd5f698..46ea855ec1 100644 --- a/tools/firmware-utils/src/osbridge-crc.c +++ b/tools/firmware-utils/src/osbridge-crc.c @@ -163,7 +163,6 @@ int main(int argc, char *argv[]) res = EXIT_SUCCESS; - out_flush: fflush(outfile); err_close_out: diff --git a/tools/firmware-utils/src/pc1crypt.c b/tools/firmware-utils/src/pc1crypt.c index 87f125a232..5eb6e01d4a 100644 --- a/tools/firmware-utils/src/pc1crypt.c +++ b/tools/firmware-utils/src/pc1crypt.c @@ -339,7 +339,6 @@ int main(int argc, char *argv[]) res = EXIT_SUCCESS; - out_flush: fflush(outfile); err_close_out: