All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Fix compiler warning in mpc8xxx ddr code
@ 2008-09-05 19:40 Kumar Gala
  2008-09-05 19:46 ` Jean-Christophe PLAGNIOL-VILLARD
  2008-09-06 23:25 ` Wolfgang Denk
  0 siblings, 2 replies; 3+ messages in thread
From: Kumar Gala @ 2008-09-05 19:40 UTC (permalink / raw)
  To: u-boot

ctrl_regs.c: In function 'compute_fsl_memctl_config_regs':
ctrl_regs.c:523: warning: 'caslat' may be used uninitialized in this function
ctrl_regs.c:523: note: 'caslat' was declared here

Add a warning in DDR1 case if cas_latency isn't a value we know about.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 cpu/mpc8xxx/ddr/ctrl_regs.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/cpu/mpc8xxx/ddr/ctrl_regs.c b/cpu/mpc8xxx/ddr/ctrl_regs.c
index ca67551..e6c2a5c 100644
--- a/cpu/mpc8xxx/ddr/ctrl_regs.c
+++ b/cpu/mpc8xxx/ddr/ctrl_regs.c
@@ -520,7 +520,7 @@ static void set_ddr_sdram_mode(fsl_ddr_cfg_regs_t *ddr,
 	unsigned int wr;	/* Write Recovery */
 	unsigned int dll_res;	/* DLL Reset */
 	unsigned int mode;	/* Normal=0 or Test=1 */
-	unsigned int caslat;	/* CAS# latency */
+	unsigned int caslat = 0;/* CAS# latency */
 	/* BT: Burst Type (0=Sequential, 1=Interleaved) */
 	unsigned int bt;
 	unsigned int bl;	/* BL: Burst Length */
@@ -572,7 +572,9 @@ static void set_ddr_sdram_mode(fsl_ddr_cfg_regs_t *ddr,
 			0x6,	/* 2.5 clocks */
 			0x3	/* 3.0 clocks */
 		};
-	caslat = mode_caslat_table[cas_latency - 1];
+		caslat = mode_caslat_table[cas_latency - 1];
+	} else {
+		printf("Warning: unknown cas_latency %d\n", cas_latency);
 	}
 #elif defined(CONFIG_FSL_DDR2)
 	caslat = cas_latency;
-- 
1.5.5.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] Fix compiler warning in mpc8xxx ddr code
  2008-09-05 19:40 [U-Boot] [PATCH] Fix compiler warning in mpc8xxx ddr code Kumar Gala
@ 2008-09-05 19:46 ` Jean-Christophe PLAGNIOL-VILLARD
  2008-09-06 23:25 ` Wolfgang Denk
  1 sibling, 0 replies; 3+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-09-05 19:46 UTC (permalink / raw)
  To: u-boot

On 14:40 Fri 05 Sep     , Kumar Gala wrote:
> ctrl_regs.c: In function 'compute_fsl_memctl_config_regs':
> ctrl_regs.c:523: warning: 'caslat' may be used uninitialized in this function
> ctrl_regs.c:523: note: 'caslat' was declared here
> 
> Add a warning in DDR1 case if cas_latency isn't a value we know about.
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
>  cpu/mpc8xxx/ddr/ctrl_regs.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 

Thanks it's fix my warnings

Ack-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Best Regards,
J.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] Fix compiler warning in mpc8xxx ddr code
  2008-09-05 19:40 [U-Boot] [PATCH] Fix compiler warning in mpc8xxx ddr code Kumar Gala
  2008-09-05 19:46 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2008-09-06 23:25 ` Wolfgang Denk
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2008-09-06 23:25 UTC (permalink / raw)
  To: u-boot

Dear Kumar Gala,

In message <1220643629-1653-1-git-send-email-galak@kernel.crashing.org> you wrote:
> ctrl_regs.c: In function 'compute_fsl_memctl_config_regs':
> ctrl_regs.c:523: warning: 'caslat' may be used uninitialized in this function
> ctrl_regs.c:523: note: 'caslat' was declared here
> 
> Add a warning in DDR1 case if cas_latency isn't a value we know about.
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Things that try to look like things often do look  more  like  things
than things. Well-known fact.       - Terry Pratchett, _Wyrd Sisters_

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-09-06 23:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-05 19:40 [U-Boot] [PATCH] Fix compiler warning in mpc8xxx ddr code Kumar Gala
2008-09-05 19:46 ` Jean-Christophe PLAGNIOL-VILLARD
2008-09-06 23:25 ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.