Sfoglia il codice sorgente

firmware-utils: fix few random warnings

1. -Wunused-label
2. -Wparentheses
3. -Wmisleading-indentation
4. -Wformat-overflow

Signed-off-by: Rafał Miłecki <[email protected]>
Rafał Miłecki 4 anni fa
parent
commit
a2f6622945

+ 1 - 1
tools/firmware-utils/src/dgn3500sum.c

@@ -104,7 +104,7 @@ int main(int argc, char** argv)
   char *endptr, *buffer, *p;
   char *endptr, *buffer, *p;
   int count;  // size of file in bytes
   int count;  // size of file in bytes
   unsigned short sum = 0, sum1 = 0;
   unsigned short sum = 0, sum1 = 0;
-  char sumbuf[9];
+  char sumbuf[8 + 8 + 1];
 
 
   if(argc < 3) {
   if(argc < 3) {
     printf("ERROR: Argument missing!\n\nUsage %s filename starting offset in hex [PID code]\n\n", argv[0]);
     printf("ERROR: Argument missing!\n\nUsage %s filename starting offset in hex [PID code]\n\n", argv[0]);

+ 0 - 1
tools/firmware-utils/src/mkdniimg.c

@@ -187,7 +187,6 @@ int main(int argc, char *argv[])
 
 
 	res = EXIT_SUCCESS;
 	res = EXIT_SUCCESS;
 
 
- out_flush:
 	fflush(outfile);
 	fflush(outfile);
 
 
  err_close_out:
  err_close_out:

+ 1 - 1
tools/firmware-utils/src/mkmylofw.c

@@ -98,7 +98,7 @@ struct cpx_board {
 #define CPX_BOARD_AR23XX(_did, _flash, _mod, _name, _desc) \
 #define CPX_BOARD_AR23XX(_did, _flash, _mod, _name, _desc) \
 	CPX_BOARD(_did, _flash, _mod, _name, _desc, 0x10000, 0x10000)
 	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	*progname;
 char	*ofname = NULL;
 char	*ofname = NULL;

+ 0 - 1
tools/firmware-utils/src/mkplanexfw.c

@@ -247,7 +247,6 @@ int main(int argc, char *argv[])
 
 
 	res = EXIT_SUCCESS;
 	res = EXIT_SUCCESS;
 
 
- out_flush:
 	fflush(outfile);
 	fflush(outfile);
 
 
  err_close_out:
  err_close_out:

+ 1 - 1
tools/firmware-utils/src/mktitanimg.c

@@ -284,7 +284,7 @@ int main(int argc, char* argv[], char* env[])
 			else
 			else
 				padding = align - ((section->raw_size+ section->offset) % align);
 				padding = align - ((section->raw_size+ section->offset) % align);
 
 
-				section->total_size=section->raw_size + padding;
+			section->total_size=section->raw_size + padding;
 		}
 		}
 		else{
 		else{
 			#define EXTRA_BLOCK 0x10000
 			#define EXTRA_BLOCK 0x10000

+ 0 - 1
tools/firmware-utils/src/osbridge-crc.c

@@ -163,7 +163,6 @@ int main(int argc, char *argv[])
 
 
 	res = EXIT_SUCCESS;
 	res = EXIT_SUCCESS;
 
 
- out_flush:
 	fflush(outfile);
 	fflush(outfile);
 
 
  err_close_out:
  err_close_out:

+ 0 - 1
tools/firmware-utils/src/pc1crypt.c

@@ -339,7 +339,6 @@ int main(int argc, char *argv[])
 
 
 	res = EXIT_SUCCESS;
 	res = EXIT_SUCCESS;
 
 
- out_flush:
 	fflush(outfile);
 	fflush(outfile);
 
 
  err_close_out:
  err_close_out: