From: Guennadi Liakhovetski Date: Thu, 7 Feb 2008 15:58:12 +0100 (CET) Subject: [U-Boot-Users] [Q] memtest doubt In-Reply-To: <47AB144D.7060508@ge.com> References: <47AB08D8.9060307@ge.com> <47AB144D.7060508@ge.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 7 Feb 2008, Jerry Van Baren wrote: > Your original question/concept still used the name "addr_mask" which caused > confusion on my part. Ahhh, that's just a variable name:-) > It really should be a length, not a mask. Of course. > Illustrating > with a hand-generated patch, what I am now hearing is the following change: > > - addr_mask = ((ulong)end - (ulong)start)/sizeof(vu_long); > + len = ((ulong)end - (ulong)start)/sizeof(vu_long); > ... > - for (offset = 1; (offset & addr_mask) != 0; offset <<= 1) { > + for (offset = 1; offset < len; offset <<= 1) { > start[offset] = pattern; > } > > That makes sense to me. Exactly. If everyone agrees, I'll try not to forget to cook up a patch. Thanks Guennadi --- Guennadi Liakhovetski