diff mbox series

[libubootenv,1/1] uboot_env: remove unused variables

Message ID 1583870679-28166-1-git-send-email-pjtexier@koncepto.io
State Accepted
Headers show
Series [libubootenv,1/1] uboot_env: remove unused variables | expand

Commit Message

'Darko Komljenovic' via swupdate March 10, 2020, 8:04 p.m. UTC
This commit removes cppcheck "style" warning.

Fixes:

[src/uboot_env.c:360]: (style) Unused variable: dev
[src/uboot_env.c:401]: (style) Unused variable: buf
[src/uboot_env.c:933]: (style) Unused variable: name
[src/uboot_env.c:933]: (style) Unused variable: tmp
[src/uboot_env.c:1035]: (style) Unused variable: fd

Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
---
 src/uboot_env.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Stefano Babic March 11, 2020, 7:38 a.m. UTC | #1
On 10.03.20 21:04, 'Pierre-Jean Texier' via swupdate wrote:
> This commit removes cppcheck "style" warning.
> 
> Fixes:
> 
> [src/uboot_env.c:360]: (style) Unused variable: dev
> [src/uboot_env.c:401]: (style) Unused variable: buf
> [src/uboot_env.c:933]: (style) Unused variable: name
> [src/uboot_env.c:933]: (style) Unused variable: tmp
> [src/uboot_env.c:1035]: (style) Unused variable: fd
> 
> Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
> ---
>  src/uboot_env.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/src/uboot_env.c b/src/uboot_env.c
> index d619ee0..036a0f1 100644
> --- a/src/uboot_env.c
> +++ b/src/uboot_env.c
> @@ -357,8 +357,6 @@ static int check_env_device(struct uboot_ctx *ctx, struct uboot_flash_env *dev)
>  
>  static bool check_compatible_devices(struct uboot_ctx *ctx)
>  {
> -	struct uboot_flash_env *dev;
> -
>  	if (!ctx->redundant)
>  		return true;
>  
> @@ -398,7 +396,6 @@ static int mtdread(struct uboot_flash_env *dev, void *data)
>  	size_t count;
>  	size_t blocksize;
>  	loff_t start;
> -	void *buf;
>  	int sectors, skip;
>  	int ret = 0;
>  
> @@ -930,7 +927,7 @@ static int libuboot_load(struct uboot_ctx *ctx)
>  
>  	if (ctx->valid) {
>  		for (line = data; *line; line = next + 1) {
> -			char *name, *value, *tmp;
> +			char *value;
>  
>  			/*
>  			 * Search the end of the string pointed by line
> @@ -1032,7 +1029,6 @@ static int libuboot_load(struct uboot_ctx *ctx)
>  #define LINE_LENGTH 1024
>  int libuboot_load_file(struct uboot_ctx *ctx, const char *filename)
>  {
> -	int fd;
>  	FILE *fp;
>  	char *buf;
>  	char *name, *value;
> 

Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/src/uboot_env.c b/src/uboot_env.c
index d619ee0..036a0f1 100644
--- a/src/uboot_env.c
+++ b/src/uboot_env.c
@@ -357,8 +357,6 @@  static int check_env_device(struct uboot_ctx *ctx, struct uboot_flash_env *dev)
 
 static bool check_compatible_devices(struct uboot_ctx *ctx)
 {
-	struct uboot_flash_env *dev;
-
 	if (!ctx->redundant)
 		return true;
 
@@ -398,7 +396,6 @@  static int mtdread(struct uboot_flash_env *dev, void *data)
 	size_t count;
 	size_t blocksize;
 	loff_t start;
-	void *buf;
 	int sectors, skip;
 	int ret = 0;
 
@@ -930,7 +927,7 @@  static int libuboot_load(struct uboot_ctx *ctx)
 
 	if (ctx->valid) {
 		for (line = data; *line; line = next + 1) {
-			char *name, *value, *tmp;
+			char *value;
 
 			/*
 			 * Search the end of the string pointed by line
@@ -1032,7 +1029,6 @@  static int libuboot_load(struct uboot_ctx *ctx)
 #define LINE_LENGTH 1024
 int libuboot_load_file(struct uboot_ctx *ctx, const char *filename)
 {
-	int fd;
 	FILE *fp;
 	char *buf;
 	char *name, *value;