[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080426210632.GW2252@cs181133002.pp.htv.fi>
Date: Sun, 27 Apr 2008 00:06:32 +0300
From: Adrian Bunk <bunk@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Ingo Molnar <mingo@...e.hu>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>, Yinghai Lu <yinghai.lu@....com>,
Yinghai Lu <yhlu.kernel@...il.com>, jbarnes@...tuousgeek.org
Subject: Re: [git pull] "big box" x86 changes, boot protocol
On Sat, Apr 26, 2008 at 01:39:28PM -0700, Andrew Morton wrote:
> On Sat, 26 Apr 2008 21:54:07 +0200 Ingo Molnar <mingo@...e.hu> wrote:
>...
> >
> > +void __init free_early(unsigned long start, unsigned long end)
> > +{
> > + struct early_res *r;
> > + int i, j;
> > +
> > + for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) {
> > + r = &early_res[i];
> > + if (start == r->start && end == r->end)
> > + break;
> > + }
> > + if (i >= MAX_EARLY_RES || !early_res[i].end)
> > + panic("free_early on not reserved area: %lx-%lx!", start, end);
> > +
> > + for (j = i + 1; j < MAX_EARLY_RES && early_res[j].end; j++)
> > + ;
> > +
> > + memcpy(&early_res[i], &early_res[i + 1],
> > + (j - 1 - i) * sizeof(struct early_res));
>
> nit: memcpy() shouldn't be used for overlapping copies. It happens to be
> OK (for dst<src) in the kernel implementations. We hope.
>...
We always use the gcc builtin for memcpy() here.
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
--
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