diff mbox

[U-Boot,9/9] board/esd/common/auto_update.c: fix Uninitialized variable

Message ID 1415278985-8482-10-git-send-email-wd@denx.de
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Wolfgang Denk Nov. 6, 2014, 1:03 p.m. UTC
cppcheck reports:

[board/esd/common/auto_update.c:458]: (error) Uninitialized variable: cnt

The variable is not really used anywhere, so remove it.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
---
 board/esd/common/auto_update.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Matthias Fuchs Nov. 6, 2014, 1:33 p.m. UTC | #1
On 11/06/2014 02:03 PM, Wolfgang Denk wrote:
> cppcheck reports:
> 
> [board/esd/common/auto_update.c:458]: (error) Uninitialized variable: cnt
> 
> The variable is not really used anywhere, so remove it.
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
> ---
>  board/esd/common/auto_update.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/board/esd/common/auto_update.c b/board/esd/common/auto_update.c
> index 85c3567..b168074 100644
> --- a/board/esd/common/auto_update.c
> +++ b/board/esd/common/auto_update.c
> @@ -377,7 +377,7 @@ int do_auto_update(void)
>  {
>  	block_dev_desc_t *stor_dev = NULL;
>  	long sz;
> -	int i, res, cnt, old_ctrlc;
> +	int i, res, old_ctrlc;
>  	char buffer[32];
>  	char str[80];
>  	int n;
> @@ -455,7 +455,6 @@ int do_auto_update(void)
>  				clear_ctrlc ();
>  				break;
>  			}
> -			cnt++;
>  		} while (res < 0);
>  	}
>  
> 
Thanks for fixing!

Acked-by: Matthias Fuchs <matthias.fuchs@esd.eu>
Tom Rini Nov. 10, 2014, 9:28 p.m. UTC | #2
On Thu, Nov 06, 2014 at 02:03:05PM +0100, Wolfgang Denk wrote:

> cppcheck reports:
> 
> [board/esd/common/auto_update.c:458]: (error) Uninitialized variable: cnt
> 
> The variable is not really used anywhere, so remove it.
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
> Acked-by: Matthias Fuchs <matthias.fuchs@esd.eu>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/board/esd/common/auto_update.c b/board/esd/common/auto_update.c
index 85c3567..b168074 100644
--- a/board/esd/common/auto_update.c
+++ b/board/esd/common/auto_update.c
@@ -377,7 +377,7 @@  int do_auto_update(void)
 {
 	block_dev_desc_t *stor_dev = NULL;
 	long sz;
-	int i, res, cnt, old_ctrlc;
+	int i, res, old_ctrlc;
 	char buffer[32];
 	char str[80];
 	int n;
@@ -455,7 +455,6 @@  int do_auto_update(void)
 				clear_ctrlc ();
 				break;
 			}
-			cnt++;
 		} while (res < 0);
 	}