[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48FCB694.40901@zytor.com>
Date: Mon, 20 Oct 2008 09:49:24 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
CC: Ingo Molnar <mingo@...e.hu>, Roland Dreier <rdreier@...co.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"David S. Miller" <davem@...emloft.net>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
linux-kernel@...r.kernel.org,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Thomas Gleixner <tglx@...utronix.de>,
David Howells <dhowells@...hat.com>
Subject: Re: [announce] new tree: "fix all build warnings, on all configs"
Linus Torvalds wrote:
>
> The old code was correct. Your code is shit. And you didn't fix
> _anything_.
>
>> case 5:
>> *(int *)to = *(int *)from;
>> - *((short *)to + 3) = *((short *)from + 3);
>> + *((char *)(to + 3)) = *((char *)(from + 3));
>> return to;
>
> Are you just making changes by randomly inserting and deleting characters
> until you don't see warnings? Or what?
>
> That thing is supposed to be a 5-byte memcpy. Not a "take a random byte
> from a random location and move it to another random location". That would
> be "randcpy()", not "memcpy()".
>
That is not a 5-byte memcopy. In *either* version!
In the "before" case, it copies bytes 0, 1, 2, 3, 6 and 7.
In the "after" case, it copies bytes 0, 1 and 2.
Presumably it *should* be:
*((char *)to + 4) = *((char *)from + 4);
-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists