From: Andreas Herrmann <andreas.herrmann3@amd.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
Yinghai Lu <yinghai@kernel.org>
Subject: Re: [PATCH] x86: memtest: fix compile warning
Date: Fri, 12 Jun 2009 15:11:45 +0200 [thread overview]
Message-ID: <20090612131145.GH12431@alberich.amd.com> (raw)
In-Reply-To: <20090611152658.GF12431@alberich.amd.com>
On Thu, Jun 11, 2009 at 05:26:58PM +0200, Andreas Herrmann wrote:
> On Thu, Jun 11, 2009 at 04:21:41PM +0200, Thomas Gleixner wrote:
> > On Thu, 11 Jun 2009, Andreas Herrmann wrote:
> >
> > > Commit c9690998ef48ffefeccb91c70a7739eebdea57f9
> > > (x86: memtest: remove 64-bit division) introduced following compile warning:
> > >
> > > arch/x86/mm/memtest.c: In function 'memtest':
> > > arch/x86/mm/memtest.c:56: warning: comparison of distinct pointer types lacks a cast
> > > arch/x86/mm/memtest.c:58: warning: comparison of distinct pointer types lacks a cast
> > >
> > > Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
> > > ---
> > > arch/x86/mm/memtest.c | 4 ++--
> > > 1 files changed, 2 insertions(+), 2 deletions(-)
> > >
> > > Sorry.
> > > Please apply.
> >
> > I applied it already, but zapped it right away, as it is bad style to
> > do the type casting in the loops. The proper fix is below.
>
> Doesn't your fix re-introduces the 64-bit division problem with old
> gcc? I removed that division with the mentioned commit just forgot to
> type-cast the pointer.
It doesn't.
> > diff --git a/arch/x86/mm/memtest.c b/arch/x86/mm/memtest.c
> > index d1c5cef..18d244f 100644
> > --- a/arch/x86/mm/memtest.c
> > +++ b/arch/x86/mm/memtest.c
> > @@ -40,16 +40,14 @@ static void __init reserve_bad_mem(u64 pattern, u64 start_bad, u64 end_bad)
> >
> > static void __init memtest(u64 pattern, u64 start_phys, u64 size)
> > {
> > - u64 *p, *end;
> > - void *start;
> > + u64 *p, *start, *end;
> > u64 start_bad, last_bad;
> > u64 start_phys_aligned;
> > - size_t incr;
> > + const size_t incr = sizeof(pattern);
The const qualifier made the difference.
Thanks,
Andreas
next prev parent reply other threads:[~2009-06-12 13:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-11 1:27 linux-next: origin tree build warning Stephen Rothwell
2009-06-11 10:29 ` [PATCH] x86: memtest: fix compile warning Andreas Herrmann
2009-06-11 11:57 ` [tip:branch?] x86: memtest: add proper typecast for pointer comparison tip-bot for Andreas Herrmann
2009-06-11 14:21 ` [PATCH] x86: memtest: fix compile warning Thomas Gleixner
2009-06-11 14:30 ` H. Peter Anvin
2009-06-11 15:26 ` Andreas Herrmann
2009-06-12 13:11 ` Andreas Herrmann [this message]
2009-06-11 17:19 ` Yinghai Lu
2009-06-11 21:05 ` Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090612131145.GH12431@alberich.amd.com \
--to=andreas.herrmann3@amd.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=sfr@canb.auug.org.au \
--cc=tglx@linutronix.de \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.