[U-Boot] [PATCH V4 1/2] MTD/SPI: introduce table driven probing

Mike Frysinger vapier at gentoo.org
Tue Sep 14 21:15:13 CEST 2010


On Tuesday, September 14, 2010 14:29:30 Reinhard Meyer wrote:
> On 14.09.2010 16:53, Mike Frysinger wrote:
> > On Tuesday, September 14, 2010 10:50:08 Reinhard Meyer wrote:
> >> for JEDEC devices without and with extension bytes
> >> for non JEDEC devices
> >> Signed-off-by: Reinhard Meyer<u-boot at emk-elektronik.de>
> > 
> > needs to be a blank line before s-o-b tags and friends
> > 
> >> - * Licensed under the GPL-2 or later.
> > 
> > this is unnecessary noise.  drop this hunk.
> 
> Drop what? The removal?

the whole license change.  leave it the way it is.

> >> +	/*
> >> +	 * count the number of continuation bytes, but
> >> +	 * leave at least 3 bytes to the end of the buffer untouched
> >> +	 */
> >> +	for (shift = 0, idp = idbuf;
> >> +		shift<  (sizeof(idbuf) - 3)&&  *idp == 0x7f;
> >> +			shift++, idp++)
> >> +		;
> > 
> > is the offset of 3 necessary ?  seems a little fragile ...
> 
> Any JEDEC device seems to have at least 3 bytes of ID. Unless we start
> passing the length of the remainder of idbuf we need to make sure the
> probe function can safely access 3 bytes.

considering we've pre-screened the length and known devices, i dont think this 
will be a problem.  i guess just extend the comment above it a little 
explaining the 3 byte logic.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100914/a322bd96/attachment.pgp 


More information about the U-Boot mailing list