[U-Boot-Users] [PATCH] Fix use of "void *" for block dev read/write buffer pointers

Grant Likely grant.likely at secretlab.ca
Thu Apr 12 18:33:41 CEST 2007


On 4/12/07, Greg Lopp <lopp at pobox.com> wrote:
> A couple months ago, a patch was submitted which changed the
> prototypes for block_write and block_read in the block_dev_desc_t
> structure (include/part.h).  For both, the buffer parameter was
> changed from a ulong* to a void*.  Seven functions were changed as a
> result of this. Four of those functions take that parameter and pass
> it to a local variable of a different type, thereby insulating them
> from this change.  The other three were not so lucky.....
<snip>
> The following patch fixes the pointer manipulation in ide_read(),
> ide_write() and atapi_read().

Yup, this is the correct fix.  Good catch.

A few comments:

1. you need to add a Signed-of-by:" line at the bottom of your comment block
2. Looks like whitespace has been mangled in this patch.  Tabs are now
spaces and long lines have been wrapped.  The patch doesn't apply.
Your mail client probably did this to you.

> blocksize in ulong */
> +               buffer+=(cnt*ATAPI_READ_BLOCK_SIZE); /* ulong
> blocksize in ulong */

3. Now that buffer is incremented by bytes, the comment no longer
applies.  Remove it in your patch.

Thanks again,
g.

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195




More information about the U-Boot mailing list