From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alessandro Rubini Date: Sat, 10 Oct 2009 09:44:31 +0200 Subject: [U-Boot] [PATCH V3 1/3] lib_generic memcpy: copy one word at a time if possible In-Reply-To: <4AD0261B.1060501@free.fr> References: <4AD0261B.1060501@free.fr> <20091009091220.GA3801@mail.gnudd.com> Message-ID: <20091010074431.GA3732@mail.gnudd.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Chris >> + unsigned long *dl = (unsigned long *)dest, *sl = (unsigned long *)src; > Nitpick: Are you sure the casts are necessary here ? Without the one on src it complains because of "const". So I write both for symetry. > + if ( (((ulong)dest | (ulong)src) & (sizeof(*dl) - 1)) == 0) { > > The "or" should not include count: the remaining count % sizeof(unsigned > long) bytes are copied below. Yes, that's why I'm sending V4 today. Actually, I booted V3 but didn't measure it, so this bug went unnoticed. But I won't measure it today, either... Ok for spaces around operators (even if the whole of string.c is strangely spaced, but that's historical). thanks /alessandro