public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 04/14] board/cray/L1/flash.c: Fix GCC 4.6 build warning
Date: Thu, 1 Dec 2011 23:10:50 +0100	[thread overview]
Message-ID: <201112012310.50999.marek.vasut@gmail.com> (raw)
In-Reply-To: <1322641077-829-5-git-send-email-wd@denx.de>

> Fix:
> flash.c: In function 'flash_erase':
> flash.c:276:24: warning: variable 'l_sect' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
> total: 0 errors, 0 warnings, 49 lines checked
> NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX
> MULTISTATEMENT_MACRO_USE_DO_WHILE
> 
>  board/cray/L1/flash.c |   25 +++++++++++--------------
>  1 files changed, 11 insertions(+), 14 deletions(-)
> 
> diff --git a/board/cray/L1/flash.c b/board/cray/L1/flash.c
> index a3d893e..77a2100 100644
> --- a/board/cray/L1/flash.c
> +++ b/board/cray/L1/flash.c
> @@ -273,7 +273,7 @@ int	flash_erase (flash_info_t *info, int s_first, 
int
> s_last) {
>  	volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *)(info->start[0]);
>  	volatile FLASH_WORD_SIZE *addr2;
> -	int flag, prot, sect, l_sect;
> +	int flag, prot, sect;
> 
>  	if ((s_first < 0) || (s_first > s_last)) {
>  		if (info->flash_id == FLASH_UNKNOWN) {
> @@ -303,16 +303,14 @@ int	flash_erase (flash_info_t *info, int s_first, 
int
> s_last) printf ("\n");
>  	}
> 
> -	l_sect = -1;
> -
>  	/* Disable interrupts which might cause a timeout here */
>  	flag = disable_interrupts();
> 
>  	/* Start erase on unprotected sectors */
>  	for (sect = s_first; sect<=s_last; sect++) {
>  		if (info->protect[sect] == 0) {	/* not protected */
> -		    addr2 = (FLASH_WORD_SIZE *)(info->start[sect]);
> -		    printf("Erasing sector %p\n", addr2);
> +			addr2 = (FLASH_WORD_SIZE *)(info->start[sect]);
> +			printf("Erasing sector %p\n", addr2);
> 
>  			addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
>  			addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
> @@ -320,15 +318,14 @@ int	flash_erase (flash_info_t *info, int s_first, 
int
> s_last) addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
>  			addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
>  			addr2[0] = (FLASH_WORD_SIZE)0x00300030;  /* sector erase 
*/
> -		    l_sect = sect;
> -		    /*
> -		     * Wait for each sector to complete, it's more
> -		     * reliable.  According to AMD Spec, you must
> -		     * issue all erase commands within a specified
> -		     * timeout.  This has been seen to fail, especially
> -		     * if printf()s are included (for debug)!!
> -		     */
> -		    wait_for_DQ7(info, sect);
> +			/*
> +			 * Wait for each sector to complete, it's more
> +			 * reliable.  According to AMD Spec, you must
> +			 * issue all erase commands within a specified
> +			 * timeout.  This has been seen to fail, especially
> +			 * if printf()s are included (for debug)!!
> +			 */
> +			wait_for_DQ7(info, sect);
>  		}
>  	}

Logically looks OK

Acked-by: Marek Vasut <marek.vasut@gmail.com>

  reply	other threads:[~2011-12-01 22:10 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-30  8:17 [U-Boot] [PATCH 00/14] More fixes GCC 4.6 build warnings Wolfgang Denk
2011-11-30  8:17 ` [U-Boot] [PATCH 01/14] alpr board: Fix " Wolfgang Denk
2011-12-01  8:55   ` Stefan Roese
2011-12-01 23:09   ` Wolfgang Denk
2011-11-30  8:17 ` [U-Boot] [PATCH 02/14] board/amirix/ap1000/flash.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-12-01 22:10   ` Marek Vasut
2011-12-01 23:10   ` Wolfgang Denk
2011-11-30  8:17 ` [U-Boot] [PATCH 03/14] drivers/block/sata_dwc.c: " Wolfgang Denk
2011-12-01 23:10   ` Wolfgang Denk
2011-11-30  8:17 ` [U-Boot] [PATCH 04/14] board/cray/L1/flash.c: " Wolfgang Denk
2011-12-01 22:10   ` Marek Vasut [this message]
2011-12-01 23:11   ` Wolfgang Denk
2011-11-30  8:17 ` [U-Boot] [PATCH 05/14] DB64360: Fix GCC 4.6 build warnings Wolfgang Denk
2011-12-01 23:11   ` Wolfgang Denk
2011-11-30  8:17 ` [U-Boot] [PATCH 06/14] DB64460: " Wolfgang Denk
2011-12-01 23:11   ` Wolfgang Denk
2011-11-30  8:17 ` [U-Boot] [PATCH 07/14] board/sandburst/common/flash.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-12-01 22:11   ` Marek Vasut
2011-12-01 23:12   ` Wolfgang Denk
2011-11-30  8:17 ` [U-Boot] [PATCH 08/14] drivers/usb/host/sl811-hcd.c: " Wolfgang Denk
2011-12-01 22:13   ` Marek Vasut
2011-12-01 23:13     ` Wolfgang Denk
2011-12-01 23:14   ` Wolfgang Denk
2011-11-30  8:17 ` [U-Boot] [PATCH 09/14] post/board/lwmon5/gdc.c: " Wolfgang Denk
2011-12-01  8:55   ` Stefan Roese
2011-12-01 23:14   ` Wolfgang Denk
2011-11-30  8:17 ` [U-Boot] [PATCH 10/14] board/mpl/common/flash.c: " Wolfgang Denk
2011-12-01 22:14   ` Marek Vasut
2011-12-01 23:15     ` Wolfgang Denk
2011-12-01 23:16   ` Wolfgang Denk
2011-11-30  8:17 ` [U-Boot] [PATCH 11/14] board/freescale/mpc8610hpcd/mpc8610hpcd.c: " Wolfgang Denk
2011-11-30 13:55   ` Kumar Gala
2011-12-01 23:16   ` Wolfgang Denk
2011-11-30  8:17 ` [U-Boot] [PATCH 12/14] arch/powerpc/cpu/mpc86xx/cpu.c: " Wolfgang Denk
2011-11-30 13:55   ` Kumar Gala
2011-12-01 23:16   ` Wolfgang Denk
2011-11-30  8:17 ` [U-Boot] [PATCH 13/14] board/sbc405/strataflash.c: " Wolfgang Denk
2011-12-01 22:14   ` Marek Vasut
2011-12-01 23:17   ` Wolfgang Denk
2011-11-30  8:17 ` [U-Boot] [PATCH 14/14] board/emk/top860/top860.c: " Wolfgang Denk
2011-12-01 23:17   ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201112012310.50999.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox