Skip to contentSkip to conversation

drivers/char/hpet.c: integer constant is too large for "long" type

PATCH In review S.Çağlar Onur 4 participants 4 messages Jul 21, 2007 – Jul 23, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/char/hpet.c: integer constant is too large for "long" type

Hi;

Following trivial patch silents

drivers/char/hpet.c:76: warning: integer constant is too large for "long" type

warning (with gcc-3.4.6)

 drivers/char/hpet.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/hpet.c +1 -1
index ba0e74a..23fadf5 100644
@@ -73,7 +73,7 @@ static struct clocksource clocksource_hpet = {
         .name           = "hpet",
         .rating         = 250,
         .read           = read_hpet,
-        .mask           = 0xffffffffffffffff,
+        .mask           = 0xffffffffffffffffLL,
         .mult           = 0, /*to be caluclated*/
         .shift          = 10,
         .flags          = CLOCK_SOURCE_IS_CONTINUOUS,

Cheers

Signature · 4 lines
S.Çağlar Onur <[email protected]>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
#1 lore raw
Quoted 16 lines · On Sat, 21 Jul 2007 14:19:44 +0300 "S.__a__lar Onur" <[email protected]>…

Following trivial patch silents

drivers/char/hpet.c:76: warning: integer constant is too large for "long" type

warning (with gcc-3.4.6)

 drivers/char/hpet.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/hpet.c +0 -0
index ba0e74a..23fadf5 100644

drivers/char/hpet.c static struct clocksource clocksource_hpet = { · line 79

Quoted 8 lines
drivers/char/hpet.c +1 -1
@@ -73,7 +73,7 @@ static struct clocksource clocksource_hpet = {
         .name           = "hpet",
         .rating         = 250,
         .read           = read_hpet,
-        .mask           = 0xffffffffffffffff,
+        .mask           = 0xffffffffffffffffLL,
         .mult           = 0, /*to be caluclated*/
         .shift          = 10,
         .flags          = CLOCK_SOURCE_IS_CONTINUOUS,

hm, well, this does assume that cycle_t is implemented as long long (or unsigned long long, actually). Which in turn assumes that u64 is implemented as [unsigned] long long.

Not all architectures use unsigned long long for u64: some use unsigned long. They'll probably be OK with this change but I think I'll convert that into plain old "-1", which just works everywhere.

#2 lore raw
Quoted 32 lines · Andrew Morton
Quoted 16 lines · On Sat, 21 Jul 2007 14:19:44 +0300 "S.__a__lar Onur" <[email protected]>…

Following trivial patch silents

drivers/char/hpet.c:76: warning: integer constant is too large for "long" type

warning (with gcc-3.4.6)

 drivers/char/hpet.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/hpet.c +0 -0
index ba0e74a..23fadf5 100644

drivers/char/hpet.c static struct clocksource clocksource_hpet = { · line 79

Quoted 8 lines
drivers/char/hpet.c +1 -1
@@ -73,7 +73,7 @@ static struct clocksource clocksource_hpet = {
         .name           = "hpet",
         .rating         = 250,
         .read           = read_hpet,
-        .mask           = 0xffffffffffffffff,
+        .mask           = 0xffffffffffffffffLL,
         .mult           = 0, /*to be caluclated*/
         .shift          = 10,
         .flags          = CLOCK_SOURCE_IS_CONTINUOUS,

hm, well, this does assume that cycle_t is implemented as long long (or unsigned long long, actually). Which in turn assumes that u64 is implemented as [unsigned] long long.

Quoted 4 lines

Not all architectures use unsigned long long for u64: some use unsigned long. They'll probably be OK with this change but I think I'll convert that into plain old "-1", which just works everywhere.

Bob Picco fixed this already -> http://lkml.org/lkml/2007/7/23/242

Regards,

Gabriel

#3 lore raw
In reply to Andrew Morton
Quoted 32 lines · Andrew Morton
Quoted 16 lines · On Sat, 21 Jul 2007 14:19:44 +0300 "S.__a__lar Onur" <[email protected]>…

Following trivial patch silents

drivers/char/hpet.c:76: warning: integer constant is too large for "long" type

warning (with gcc-3.4.6)

 drivers/char/hpet.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/hpet.c +0 -0
index ba0e74a..23fadf5 100644

drivers/char/hpet.c static struct clocksource clocksource_hpet = { · line 79

Quoted 8 lines
drivers/char/hpet.c +1 -1
@@ -73,7 +73,7 @@ static struct clocksource clocksource_hpet = {
         .name           = "hpet",
         .rating         = 250,
         .read           = read_hpet,
-        .mask           = 0xffffffffffffffff,
+        .mask           = 0xffffffffffffffffLL,
         .mult           = 0, /*to be caluclated*/
         .shift          = 10,
         .flags          = CLOCK_SOURCE_IS_CONTINUOUS,

hm, well, this does assume that cycle_t is implemented as long long (or unsigned long long, actually). Which in turn assumes that u64 is implemented as [unsigned] long long.

Quoted 3 lines

Not all architectures use unsigned long long for u64: some use unsigned long. They'll probably be OK with this change but I think I'll convert that into plain old "-1", which just works everywhere.

.mask = CLOCKSOURCE_MASK(64)

should work

tglx