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 |
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 --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;
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(-)