public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.23-rc5] driver/char/hpet.c: remove clocksource warning on !IA64
@ 2007-09-01 15:51 Daniel Walker
  2007-09-01 20:38 ` Daniel Walker
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Walker @ 2007-09-01 15:51 UTC (permalink / raw)
  To: torvalds; +Cc: Bob Picco, Tony Luck, linux-kernel

The warnings,

drivers/char/hpet.c:72: warning: 'clocksource_hpet' defined but not used
drivers/char/hpet.c:81: warning: 'hpet_clocksource' defined but not used

from,

commit 3b2b64fd311c92f2137eb7cee7025794cd854057
Author: Linus Torvalds <torvalds@woody.linux-foundation.org>
Date:   Fri Aug 31 20:13:57 2007 -0700


This patch eliminates the warnings when the clocksoure isn't used.
It also removes some other unused stuff that goes along with the
clocksource ..

I don't have access to an ia64 machine, or even a compiler .. So this
one is untested for that. I'm hoping one of the ia64 guys can help
test this?

Signed-off-by: Daniel Walker <dwalker@mvista.com>

---
 drivers/char/hpet.c |   32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

Index: linux-2.6.22/drivers/char/hpet.c
===================================================================
--- linux-2.6.22.orig/drivers/char/hpet.c
+++ linux-2.6.22/drivers/char/hpet.c
@@ -62,6 +62,7 @@
 
 static u32 hpet_nhpet, hpet_max_freq = HPET_USER_FREQ;
 
+#ifdef CONFIG_IA64
 static void __iomem *hpet_mctr;
 
 static cycle_t read_hpet(void)
@@ -80,6 +81,23 @@ static struct clocksource clocksource_hp
 };
 static struct clocksource *hpet_clocksource;
 
+/* This clocksource driver currently only works on ia64 */
+static inline void ia64_clocksource_register(void)
+{
+	if (!hpet_clocksource) {
+		hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc;
+		CLKSRC_FSYS_MMIO_SET(clocksource_hpet.fsys_mmio, hpet_mctr);
+		clocksource_hpet.mult = clocksource_hz2mult(hpetp->hp_tick_freq,
+						clocksource_hpet.shift);
+		clocksource_register(&clocksource_hpet);
+		hpetp->hp_clocksource = &clocksource_hpet;
+		hpet_clocksource = &clocksource_hpet;
+	}
+}
+#else
+static inline void ia64_clocksource_register(void) { }
+#endif
+
 /* A lock for concurrent access by app and isr hpet activity. */
 static DEFINE_SPINLOCK(hpet_lock);
 /* A lock for concurrent intermodule access to hpet and isr hpet activity. */
@@ -909,18 +927,8 @@ int hpet_alloc(struct hpet_data *hdp)
 
 	hpetp->hp_delta = hpet_calibrate(hpetp);
 
-/* This clocksource driver currently only works on ia64 */
-#ifdef CONFIG_IA64
-	if (!hpet_clocksource) {
-		hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc;
-		CLKSRC_FSYS_MMIO_SET(clocksource_hpet.fsys_mmio, hpet_mctr);
-		clocksource_hpet.mult = clocksource_hz2mult(hpetp->hp_tick_freq,
-						clocksource_hpet.shift);
-		clocksource_register(&clocksource_hpet);
-		hpetp->hp_clocksource = &clocksource_hpet;
-		hpet_clocksource = &clocksource_hpet;
-	}
-#endif
+	ia64_clocksource_register();
+
 
 	return 0;
 }
-- 

-- 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.23-rc5] driver/char/hpet.c: remove clocksource warning on !IA64
  2007-09-01 15:51 [PATCH 2.6.23-rc5] driver/char/hpet.c: remove clocksource warning on !IA64 Daniel Walker
@ 2007-09-01 20:38 ` Daniel Walker
  2007-09-02  7:13   ` [PATCH 2.6.23-rc5] driver/char/hpet.c: remove clocksourcewarning " Luck, Tony
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Walker @ 2007-09-01 20:38 UTC (permalink / raw)
  To: torvalds; +Cc: Bob Picco, Tony Luck, linux-kernel

On Sat, 2007-09-01 at 08:51 -0700, Daniel Walker wrote:
> The warnings,
> 
> drivers/char/hpet.c:72: warning: 'clocksource_hpet' defined but not used
> drivers/char/hpet.c:81: warning: 'hpet_clocksource' defined but not used
> 
> from,
> 
> commit 3b2b64fd311c92f2137eb7cee7025794cd854057
> Author: Linus Torvalds <torvalds@woody.linux-foundation.org>
> Date:   Fri Aug 31 20:13:57 2007 -0700

Arg, forgot the most important variable. The new function I created
needed the hpetp variable. So I added that in the patch below.. I tested
both of the ifdef blocks on i386 by just removing the ifdefs .. So it
compiles both ways ..

----

Subject: driver/char/hpet.c: remove clocksource warning on !IA64

The warnings,

drivers/char/hpet.c:72: warning: 'clocksource_hpet' defined but not used
drivers/char/hpet.c:81: warning: 'hpet_clocksource' defined but not used

from,

commit 3b2b64fd311c92f2137eb7cee7025794cd854057
Author: Linus Torvalds <torvalds@woody.linux-foundation.org>
Date:   Fri Aug 31 20:13:57 2007 -0700


This patch eliminates the warnings when the clocksoure isn't used.
It also removes some other unused stuff that goes along with the
clocksource ..

I don't have access to an ia64 machine, or even a compiler .. So this
one is untested for that. I'm hoping one of the ia64 guys can help
test this

Signed-off-by: Daniel Walker <dwalker@mvista.com>

---
 drivers/char/hpet.c |   68 +++++++++++++++++++++++++++++-----------------------
 1 file changed, 38 insertions(+), 30 deletions(-)

Index: linux-2.6.22/drivers/char/hpet.c
===================================================================
--- linux-2.6.22.orig/drivers/char/hpet.c
+++ linux-2.6.22/drivers/char/hpet.c
@@ -62,24 +62,6 @@
 
 static u32 hpet_nhpet, hpet_max_freq = HPET_USER_FREQ;
 
-static void __iomem *hpet_mctr;
-
-static cycle_t read_hpet(void)
-{
-	return (cycle_t)read_counter((void __iomem *)hpet_mctr);
-}
-
-static struct clocksource clocksource_hpet = {
-        .name           = "hpet",
-        .rating         = 250,
-        .read           = read_hpet,
-        .mask           = CLOCKSOURCE_MASK(64),
-        .mult           = 0, /*to be caluclated*/
-        .shift          = 10,
-        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
-};
-static struct clocksource *hpet_clocksource;
-
 /* A lock for concurrent access by app and isr hpet activity. */
 static DEFINE_SPINLOCK(hpet_lock);
 /* A lock for concurrent intermodule access to hpet and isr hpet activity. */
@@ -116,6 +98,42 @@ struct hpets {
 
 static struct hpets *hpets;
 
+#ifdef CONFIG_IA64
+static void __iomem *hpet_mctr;
+
+static cycle_t read_hpet(void)
+{
+	return (cycle_t)read_counter((void __iomem *)hpet_mctr);
+}
+
+static struct clocksource clocksource_hpet = {
+        .name           = "hpet",
+        .rating         = 250,
+        .read           = read_hpet,
+        .mask           = CLOCKSOURCE_MASK(64),
+        .mult           = 0, /*to be caluclated*/
+        .shift          = 10,
+        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+static struct clocksource *hpet_clocksource;
+
+/* This clocksource driver currently only works on ia64 */
+static inline void ia64_clocksource_register(struct hpets *hpetp)
+{
+	if (!hpet_clocksource) {
+		hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc;
+		CLKSRC_FSYS_MMIO_SET(clocksource_hpet.fsys_mmio, hpet_mctr);
+		clocksource_hpet.mult = clocksource_hz2mult(hpetp->hp_tick_freq,
+						clocksource_hpet.shift);
+		clocksource_register(&clocksource_hpet);
+		hpetp->hp_clocksource = &clocksource_hpet;
+		hpet_clocksource = &clocksource_hpet;
+	}
+}
+#else
+static inline void ia64_clocksource_register(struct hpets *hpetp) { }
+#endif
+
 #define	HPET_OPEN		0x0001
 #define	HPET_IE			0x0002	/* interrupt enabled */
 #define	HPET_PERIODIC		0x0004
@@ -909,18 +927,8 @@ int hpet_alloc(struct hpet_data *hdp)
 
 	hpetp->hp_delta = hpet_calibrate(hpetp);
 
-/* This clocksource driver currently only works on ia64 */
-#ifdef CONFIG_IA64
-	if (!hpet_clocksource) {
-		hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc;
-		CLKSRC_FSYS_MMIO_SET(clocksource_hpet.fsys_mmio, hpet_mctr);
-		clocksource_hpet.mult = clocksource_hz2mult(hpetp->hp_tick_freq,
-						clocksource_hpet.shift);
-		clocksource_register(&clocksource_hpet);
-		hpetp->hp_clocksource = &clocksource_hpet;
-		hpet_clocksource = &clocksource_hpet;
-	}
-#endif
+	ia64_clocksource_register(hpetp);
+
 
 	return 0;
 }



^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 2.6.23-rc5] driver/char/hpet.c: remove clocksourcewarning on !IA64
  2007-09-01 20:38 ` Daniel Walker
@ 2007-09-02  7:13   ` Luck, Tony
  2007-09-03 10:50     ` Bob Picco
  0 siblings, 1 reply; 4+ messages in thread
From: Luck, Tony @ 2007-09-02  7:13 UTC (permalink / raw)
  To: Daniel Walker, torvalds; +Cc: Bob Picco, linux-kernel

> This patch eliminates the warnings when the clocksoure isn't used.
> It also removes some other unused stuff that goes along with the
> clocksource ..
>
> I don't have access to an ia64 machine, or even a compiler .. So this
> one is untested for that. I'm hoping one of the ia64 guys can help
> test this

Well, it does *compile* cleanly for ia64 [none of my test systems actually
have a functional HPET ... the closest I get is one that fails the hd_nirqs
part of the "if (!data.hd_address || !data.hd_nirqs) {" test in hpet_acpi_add].

Bob: Does this work for you?

-Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.23-rc5] driver/char/hpet.c: remove clocksourcewarning on !IA64
  2007-09-02  7:13   ` [PATCH 2.6.23-rc5] driver/char/hpet.c: remove clocksourcewarning " Luck, Tony
@ 2007-09-03 10:50     ` Bob Picco
  0 siblings, 0 replies; 4+ messages in thread
From: Bob Picco @ 2007-09-03 10:50 UTC (permalink / raw)
  To: Luck, Tony; +Cc: Daniel Walker, torvalds, Bob Picco, linux-kernel

luck wrote:	[Sun Sep 02 2007, 03:13:45AM EDT]
> > This patch eliminates the warnings when the clocksoure isn't used.
> > It also removes some other unused stuff that goes along with the
> > clocksource ..
> >
> > I don't have access to an ia64 machine, or even a compiler .. So this
> > one is untested for that. I'm hoping one of the ia64 guys can help
> > test this
> 
> Well, it does *compile* cleanly for ia64 [none of my test systems actually
> have a functional HPET ... the closest I get is one that fails the hd_nirqs
> part of the "if (!data.hd_address || !data.hd_nirqs) {" test in hpet_acpi_add].
> 
> Bob: Does this work for you?
I boot tested on the HP internal platform simulator. Should it be
necessary, I could have it boot tested later in the week on real
hardware.

bob

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-09-03 11:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-01 15:51 [PATCH 2.6.23-rc5] driver/char/hpet.c: remove clocksource warning on !IA64 Daniel Walker
2007-09-01 20:38 ` Daniel Walker
2007-09-02  7:13   ` [PATCH 2.6.23-rc5] driver/char/hpet.c: remove clocksourcewarning " Luck, Tony
2007-09-03 10:50     ` Bob Picco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox