All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Ken Chen <kenchen@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Miller <davem@davemloft.net>,
	sparclinux <sparclinux@vger.kernel.org>,
	mingo@elte.hu, sfr@canb.auug.org.au,
	linux-kernel@vger.kernel.org, paulus@samba.org,
	tglx@linutronix.de, hpa@zytor.com, linux-next@vger.kernel.org
Subject: Re: [PATCH] sparc64: use unsigned long long for u64
Date: Tue, 23 Dec 2008 18:26:10 +0100	[thread overview]
Message-ID: <20081223172610.GA5957@uranus.ravnborg.org> (raw)
In-Reply-To: <b040c32a0812230905q3a257163r35373b0cb50df35c@mail.gmail.com>

On Tue, Dec 23, 2008 at 09:05:44AM -0800, Ken Chen wrote:
> On Tue, Dec 23, 2008 at 5:17 AM, Sam Ravnborg <sam@ravnborg.org> wrote:
> > Andrew Morton wrote:
> >
> >    People keep on doing
> >
> >            printk("%llu", some_u64);
> >
> >    testing it only on x86_64 and this generates a warning storm on
> >    powerpc, sparc64, etc.  Because they use `long', not `long long'.
> >
> >    Quite a few 64-bit architectures are using `long' for their
> >    s64/u64 types.  We should convert them all to `long long'.
> >
> > Update types.h so we use unsigned long long for u64 and
> > fix all warnings in sparc64 code.
> > Tested with an allnoconfig, defconfig and allmodconfig builds.
> >
> > This patch introduces additional warnings in several drivers.
> > These will be dealt with in separate patches.
> >
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > ---
> >
> > It may take a few days before the drivers gets fixed.
> > Christmas is approaching fast by now.
> >
> >        Sam
> >
> > diff --git a/arch/sparc/include/asm/timer_64.h b/arch/sparc/include/asm/timer_64.h
> > index 5b779fd..ef3c368 100644
> > --- a/arch/sparc/include/asm/timer_64.h
> > +++ b/arch/sparc/include/asm/timer_64.h
> > @@ -10,7 +10,7 @@
> >  #include <linux/init.h>
> >
> >  struct sparc64_tick_ops {
> > -       unsigned long (*get_tick)(void);
> > +       unsigned long long (*get_tick)(void);
> 
> wait, why does this need to be changed?

We have:
        clocksource_tick.read = tick_ops->get_tick;

And clocksource_tick is of type clocksource:

struct clocksource {
	...
        cycle_t (*read)(void);

And cycle_t is:
/* clocksource cycle base type */
typedef u64 cycle_t;

And u64 is now:
unsigned long long - thus we need to fix prototype
of get_tick to fix the warnings.

A cast could do it - but fixing the real problem
is better here.

	Sam

WARNING: multiple messages have this Message-ID (diff)
From: Sam Ravnborg <sam@ravnborg.org>
To: Ken Chen <kenchen@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Miller <davem@davemloft.net>,
	sparclinux <sparclinux@vger.kernel.org>,
	mingo@elte.hu, sfr@canb.auug.org.au,
	linux-kernel@vger.kernel.org, paulus@samba.org,
	tglx@linutronix.de, hpa@zytor.com, linux-next@vger.kernel.org
Subject: Re: [PATCH] sparc64: use unsigned long long for u64
Date: Tue, 23 Dec 2008 17:26:10 +0000	[thread overview]
Message-ID: <20081223172610.GA5957@uranus.ravnborg.org> (raw)
In-Reply-To: <b040c32a0812230905q3a257163r35373b0cb50df35c@mail.gmail.com>

On Tue, Dec 23, 2008 at 09:05:44AM -0800, Ken Chen wrote:
> On Tue, Dec 23, 2008 at 5:17 AM, Sam Ravnborg <sam@ravnborg.org> wrote:
> > Andrew Morton wrote:
> >
> >    People keep on doing
> >
> >            printk("%llu", some_u64);
> >
> >    testing it only on x86_64 and this generates a warning storm on
> >    powerpc, sparc64, etc.  Because they use `long', not `long long'.
> >
> >    Quite a few 64-bit architectures are using `long' for their
> >    s64/u64 types.  We should convert them all to `long long'.
> >
> > Update types.h so we use unsigned long long for u64 and
> > fix all warnings in sparc64 code.
> > Tested with an allnoconfig, defconfig and allmodconfig builds.
> >
> > This patch introduces additional warnings in several drivers.
> > These will be dealt with in separate patches.
> >
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > ---
> >
> > It may take a few days before the drivers gets fixed.
> > Christmas is approaching fast by now.
> >
> >        Sam
> >
> > diff --git a/arch/sparc/include/asm/timer_64.h b/arch/sparc/include/asm/timer_64.h
> > index 5b779fd..ef3c368 100644
> > --- a/arch/sparc/include/asm/timer_64.h
> > +++ b/arch/sparc/include/asm/timer_64.h
> > @@ -10,7 +10,7 @@
> >  #include <linux/init.h>
> >
> >  struct sparc64_tick_ops {
> > -       unsigned long (*get_tick)(void);
> > +       unsigned long long (*get_tick)(void);
> 
> wait, why does this need to be changed?

We have:
        clocksource_tick.read = tick_ops->get_tick;

And clocksource_tick is of type clocksource:

struct clocksource {
	...
        cycle_t (*read)(void);

And cycle_t is:
/* clocksource cycle base type */
typedef u64 cycle_t;

And u64 is now:
unsigned long long - thus we need to fix prototype
of get_tick to fix the warnings.

A cast could do it - but fixing the real problem
is better here.

	Sam

  reply	other threads:[~2008-12-23 17:24 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-22  4:22 linux-next: sched tree build warning Stephen Rothwell
2008-12-22  6:47 ` Ingo Molnar
2008-12-22  6:49 ` Ken Chen
2008-12-22  7:04   ` Ingo Molnar
2008-12-22  7:19     ` Stephen Rothwell
2008-12-22  8:03       ` [patch] powerpc: change u64/s64 to a long long integer type Ingo Molnar
2008-12-22 22:43         ` Andrew Morton
2008-12-22 23:00           ` Sam Ravnborg
2008-12-22 23:03             ` H. Peter Anvin
2008-12-22 23:13               ` Sam Ravnborg
2008-12-22 23:13             ` Andrew Morton
2008-12-23 13:17               ` [PATCH] sparc64: use unsigned long long for u64 Sam Ravnborg
2008-12-23 13:17                 ` Sam Ravnborg
2008-12-23 13:17                 ` Sam Ravnborg
2008-12-23 14:42                 ` [PATCH] sparc64: fix unsigned long long warnings in drivers Sam Ravnborg
2008-12-23 14:42                   ` Sam Ravnborg
2008-12-23 17:05                 ` [PATCH] sparc64: use unsigned long long for u64 Ken Chen
2008-12-23 17:05                   ` Ken Chen
2008-12-23 17:26                   ` Sam Ravnborg [this message]
2008-12-23 17:26                     ` Sam Ravnborg
2008-12-23 17:29                     ` Ken Chen
2008-12-23 17:29                       ` Ken Chen
2008-12-23 17:34                       ` Sam Ravnborg
2008-12-23 17:34                         ` Sam Ravnborg
2008-12-27  8:54                 ` David Miller
2008-12-27  8:54                   ` David Miller
2008-12-27  8:54                   ` David Miller
2008-12-27  9:24                   ` Sam Ravnborg
2008-12-27  9:24                     ` Sam Ravnborg
2008-12-27  9:37                     ` David Miller
2008-12-27  9:37                       ` David Miller
2008-12-27  9:49                       ` Sam Ravnborg
2008-12-27  9:49                         ` Sam Ravnborg
2008-12-28  4:25                         ` David Miller
2008-12-28  4:25                           ` David Miller
2008-12-28 12:32                           ` Sam Ravnborg
2008-12-28 12:32                             ` Sam Ravnborg
2008-12-31  4:40         ` [patch] powerpc: change u64/s64 to a long long integer type Stephen Rothwell
2008-12-31  7:52           ` Ingo Molnar
2008-12-22  8:14     ` linux-next: sched tree build warning Paul Mackerras
2008-12-22  8:18       ` Ingo Molnar
2008-12-22  9:44         ` Paul Mackerras
2008-12-22 10:53           ` Ingo Molnar
2008-12-22 12:03             ` Paul Mackerras

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=20081223172610.GA5957@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=hpa@zytor.com \
    --cc=kenchen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=sfr@canb.auug.org.au \
    --cc=sparclinux@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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.