Hi Wolfgang,
On Sat, Nov 3, 2012 at 8:31 AM, Wolfgang Denk <[email protected]> wrote:
> Dear Simon Glass,
>
> In message <[email protected]> you wrote:
>> From: Vincent Palatin <[email protected]>
>>
>> The name is already copied when we memopy the whole structure.
>
> memopy?
>
Done
>> --- a/common/stdio.c
>> +++ b/common/stdio.c
>> @@ -135,7 +135,6 @@ struct stdio_dev* stdio_clone(struct stdio_dev *dev)
>> return NULL;
>>
>> memcpy(_dev, dev, sizeof(struct stdio_dev));
>> - strncpy(_dev->name, dev->name, 16);
>
> _dev contains just the pointer, not the data, so why can we omit
> copying the data?
I will add more detail to the commit message:
This is because struct stdio_dev has this field:
char name[16]; /* Device name
*/
So the data is inline, rather than being a pointer.
>
> 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: [email protected]
> "It is better for civilization to be going down the drain than to be
> coming up it." - Henry Allen
Regards,
Simon
_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot