All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Wei <jiaweiwei.xiyou@gmail.com>
To: Connor Hansen <cmdkhh@gmail.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	randy.dunlap@oracle.com, greg@kroah.com, joe@perches.com
Subject: Re: [PATCH RESEND]Remove a warning for drivers/edac/i82975x_edac.c
Date: Thu, 9 Jun 2011 13:25:17 +0800	[thread overview]
Message-ID: <20110609052509.GA3997@gmail.com> (raw)
In-Reply-To: <BANLkTim_=2kWXAzkECC4A3t9uxGERwBU7g@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown-8bit, Size: 2611 bytes --]

On Wed, Jun 08, 2011 at 09:26:46PM -0700, Connor Hansen wrote:
> When I compile 3.0.0-rc2+ I don't get this warning.
> please make sure this issue still exists.
I have not compiled 3.0.0-rc2+, but
i fetch portions of drivers/edac/i82975x_edac.c
of 3.0.0-rc2+ like below.

[...]
296         page = (unsigned long) info->eap;
297         if (info->xeap & 1)
298                 page |= 0x100000000ul;
299         chan = page & 1;
300         page >>= 1;
[...]

The following codes prove this warning
remians.

#include <stdio.h>

int main(void)
{
	unsigned long a;

	a = 0x100000000ul;
	printf("%lu\n", a);
	return 0;
}

jiawei@jiawei-laptop:~/GTK$ gcc 5.c -Wall -o 1
5.c: In function ‘main’:
5.c:7: warning: integer constant is too large for ‘unsigned long’ type
5.c:7: warning: large integer implicitly truncated to unsigned type

But if you program it like below, it is well for us.

#include <stdio.h>

int main(void)
{
	unsigned long long a;

	a = 0x100000000ull;
	printf("%llu\n", a);
	return 0;
}

Thanks
Harry Wei
> Connor
> 
> On Wed, Jun 8, 2011 at 8:04 PM, Harry Wei <jiaweiwei.xiyou@gmail.com> wrote:
> > From: Harry Wei <harryxiyou@gmail.com>
> >
> > When i compile 2.6.39.1, a warning shows like below.
> > This patch can fix the warning. And i works well with
> > my PC.
> >
> > [...]
> > CC [M] ??drivers/edac/e752x_edac.o
> > CC [M] ??drivers/edac/i82875p_edac.o
> > CC [M] ??drivers/edac/i82975x_edac.o
> > drivers/edac/i82975x_edac.c: In function ?????????i82975x_process_error_info?????????:
> > drivers/edac/i82975x_edac.c:298: warning: integer constant is too large for ?????????unsigned long????????? type
> > CC [M] ??drivers/edac/i3000_edac.o
> > CC [M] ??drivers/edac/i3200_edac.o
> > CC [M] ??drivers/edac/x38_edac.o
> > CC [M] ??drivers/edac/i82860_edac.o
> > [...]
> >
> >
> > Signed-off-by: Harry Wei <harryxiyou@gmail.com>
> > Index: prj/drivers/edac/i82975x_edac.c
> > ===================================================================
> > --- prj.orig/drivers/edac/i82975x_edac.c ?? ?? ?? ??2011-06-04 10:09:55.351174516 +0800
> > +++ prj/drivers/edac/i82975x_edac.c ?? ?? 2011-06-04 10:10:30.875168437 +0800
> > @@ -293,9 +293,9 @@
> > ?? ?? ?? ?? ?? ?? ?? ??info->errsts = info->errsts2;
> > ?? ?? ?? ??}
> >
> > - ?? ?? ?? page = (unsigned long) info->eap;
> > + ?? ?? ?? page = (unsigned long long) info->eap;
> > ?? ?? ?? ??if (info->xeap & 1)
> > - ?? ?? ?? ?? ?? ?? ?? page |= 0x100000000ul;
> > + ?? ?? ?? ?? ?? ?? ?? page |= 0x100000000ull;
> > ?? ?? ?? ??chan = page & 1;
> > ?? ?? ?? ??page >>= 1;
> > ?? ?? ?? ??offst = page & ((1 << PAGE_SHIFT) - 1);
> > --

  reply	other threads:[~2011-06-09  5:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09  3:04 [PATCH RESEND]Remove a warning for drivers/edac/i82975x_edac.c Harry Wei
2011-06-09  4:26 ` Connor Hansen
2011-06-09  5:25   ` Harry Wei [this message]
2011-06-09  6:17     ` Connor Hansen
2011-06-10  5:07       ` Harry Wei
2011-06-09 16:35   ` Randy Dunlap
2011-06-09 17:37 ` Randy Dunlap
2011-06-10  5:20   ` Harry Wei
2011-06-10  6:42     ` Connor Hansen
2011-06-12 15:50       ` Arvind R

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=20110609052509.GA3997@gmail.com \
    --to=jiaweiwei.xiyou@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cmdkhh@gmail.com \
    --cc=greg@kroah.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    /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.