public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Documentation/timers/hpet_example.c compile bug
@ 2010-05-28 11:35 Heiko Carstens
  2010-05-29 18:41 ` Randy Dunlap
  2010-06-01  2:30 ` [PATCH] Documentation/timers/hpet_example.c: only build on X64 Randy Dunlap
  0 siblings, 2 replies; 9+ messages in thread
From: Heiko Carstens @ 2010-05-28 11:35 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kernel

Hi Randy,

since your commit e61863099f58e458f08c101da87da752a1e009f5
"Documentation/timers/: split txt and source files" I get this compile
error on s390 with an allyesconfig:

In file included from Documentation/timers/hpet_example.c:15:
/usr/include/linux/hpet.h:11: error: expected specifier-qualifier-list before 'u64'

Please fix.

Thanks!

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

* Re: Documentation/timers/hpet_example.c compile bug
  2010-05-28 11:35 Documentation/timers/hpet_example.c compile bug Heiko Carstens
@ 2010-05-29 18:41 ` Randy Dunlap
  2010-05-31  2:34   ` Randy Dunlap
  2010-06-01  2:30 ` [PATCH] Documentation/timers/hpet_example.c: only build on X64 Randy Dunlap
  1 sibling, 1 reply; 9+ messages in thread
From: Randy Dunlap @ 2010-05-29 18:41 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: linux-kernel

On 05/28/10 04:35, Heiko Carstens wrote:
> Hi Randy,
> 
> since your commit e61863099f58e458f08c101da87da752a1e009f5
> "Documentation/timers/: split txt and source files" I get this compile
> error on s390 with an allyesconfig:
> 
> In file included from Documentation/timers/hpet_example.c:15:
> /usr/include/linux/hpet.h:11: error: expected specifier-qualifier-list before 'u64'

Where is the u64?  My (x86_64) copy of /usr/include/linux/hpet.h looks like:

     1	#ifndef	__HPET__
     2	#define	__HPET__ 1
     3	
     4	
     5	
     6	
     7	struct hpet_info {
     8		unsigned long hi_ireqfreq;	/* Hz */
     9		unsigned long hi_flags;	/* information */
    10		unsigned short hi_hpet;
    11		unsigned short hi_timer;
    12	};
    13	
    14	#define HPET_INFO_PERIODIC	0x0010	/* periodic-capable comparator */
    15	
    16	#define	HPET_IE_ON	_IO('h', 0x01)	/* interrupt on */
    17	#define	HPET_IE_OFF	_IO('h', 0x02)	/* interrupt off */
    18	#define	HPET_INFO	_IOR('h', 0x03, struct hpet_info)
    19	#define	HPET_EPI	_IO('h', 0x04)	/* enable periodic */
    20	#define	HPET_DPI	_IO('h', 0x05)	/* disable periodic */
    21	#define	HPET_IRQFREQ	_IOW('h', 0x6, unsigned long)	/* IRQFREQ usec */
    22	
    23	#endif				/* !__HPET__ */

I guess s390 hpet.h looks different?  Does it just need to #include <linux/types.h> ?
Or is the problem the kernel-space u64 vs. userspace __u64?

> Please fix.

Any suggestions?

-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: Documentation/timers/hpet_example.c compile bug
  2010-05-29 18:41 ` Randy Dunlap
@ 2010-05-31  2:34   ` Randy Dunlap
  2010-05-31  2:49     ` Arjan van de Ven
  0 siblings, 1 reply; 9+ messages in thread
From: Randy Dunlap @ 2010-05-31  2:34 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: linux-kernel

On 05/29/10 11:41, Randy Dunlap wrote:
> On 05/28/10 04:35, Heiko Carstens wrote:
>> Hi Randy,
>>
>> since your commit e61863099f58e458f08c101da87da752a1e009f5
>> "Documentation/timers/: split txt and source files" I get this compile
>> error on s390 with an allyesconfig:
>>
>> In file included from Documentation/timers/hpet_example.c:15:
>> /usr/include/linux/hpet.h:11: error: expected specifier-qualifier-list before 'u64'
> 
> Where is the u64?  My (x86_64) copy of /usr/include/linux/hpet.h looks like:
> 
>      1	#ifndef	__HPET__
>      2	#define	__HPET__ 1
>      3	
>      4	
>      5	
>      6	
>      7	struct hpet_info {
>      8		unsigned long hi_ireqfreq;	/* Hz */
>      9		unsigned long hi_flags;	/* information */
>     10		unsigned short hi_hpet;
>     11		unsigned short hi_timer;
>     12	};
>     13	
>     14	#define HPET_INFO_PERIODIC	0x0010	/* periodic-capable comparator */
>     15	
>     16	#define	HPET_IE_ON	_IO('h', 0x01)	/* interrupt on */
>     17	#define	HPET_IE_OFF	_IO('h', 0x02)	/* interrupt off */
>     18	#define	HPET_INFO	_IOR('h', 0x03, struct hpet_info)
>     19	#define	HPET_EPI	_IO('h', 0x04)	/* enable periodic */
>     20	#define	HPET_DPI	_IO('h', 0x05)	/* disable periodic */
>     21	#define	HPET_IRQFREQ	_IOW('h', 0x6, unsigned long)	/* IRQFREQ usec */
>     22	
>     23	#endif				/* !__HPET__ */
> 
> I guess s390 hpet.h looks different?  Does it just need to #include <linux/types.h> ?
> Or is the problem the kernel-space u64 vs. userspace __u64?
> 
>> Please fix.
> 
> Any suggestions?

Does it even make sense to build hpet_example on s390?
I.e., does s390 have hpet?
If not, then a simple Kconfig "depends on X86" or "depends on !S390" will fix this.

-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: Documentation/timers/hpet_example.c compile bug
  2010-05-31  2:34   ` Randy Dunlap
@ 2010-05-31  2:49     ` Arjan van de Ven
  2010-05-31  2:58       ` Randy Dunlap
  0 siblings, 1 reply; 9+ messages in thread
From: Arjan van de Ven @ 2010-05-31  2:49 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Heiko Carstens, linux-kernel

On Sun, 30 May 2010 19:34:35 -0700
Randy Dunlap <randy.dunlap@oracle.com> wrote:
> 
> Does it even make sense to build hpet_example on s390?
> I.e., does s390 have hpet?
> If not, then a simple Kconfig "depends on X86" or "depends on !S390"
> will fix this.

HPET is very PC specific.

but.. even on x86, it does not really make sense, and exposing this as
an interface to userspace is a historical mistake, the use of which we
really ought to discourage.

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

* Re: Documentation/timers/hpet_example.c compile bug
  2010-05-31  2:49     ` Arjan van de Ven
@ 2010-05-31  2:58       ` Randy Dunlap
  2010-05-31  3:10         ` Arjan van de Ven
  0 siblings, 1 reply; 9+ messages in thread
From: Randy Dunlap @ 2010-05-31  2:58 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: Heiko Carstens, linux-kernel

On 05/30/10 19:49, Arjan van de Ven wrote:
> On Sun, 30 May 2010 19:34:35 -0700
> Randy Dunlap <randy.dunlap@oracle.com> wrote:
>>
>> Does it even make sense to build hpet_example on s390?
>> I.e., does s390 have hpet?
>> If not, then a simple Kconfig "depends on X86" or "depends on !S390"
>> will fix this.
> 
> HPET is very PC specific.
> 
> but.. even on x86, it does not really make sense, and exposing this as
> an interface to userspace is a historical mistake, the use of which we
> really ought to discourage.

Do you mean exposing anything that is in /usr/include/linux/hpet.h via ioctls?
especially struct hpet_info ?

-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: Documentation/timers/hpet_example.c compile bug
  2010-05-31  2:58       ` Randy Dunlap
@ 2010-05-31  3:10         ` Arjan van de Ven
  0 siblings, 0 replies; 9+ messages in thread
From: Arjan van de Ven @ 2010-05-31  3:10 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Heiko Carstens, linux-kernel

On Sun, 30 May 2010 19:58:38 -0700
Randy Dunlap <randy.dunlap@oracle.com> wrote:

> On 05/30/10 19:49, Arjan van de Ven wrote:
> > On Sun, 30 May 2010 19:34:35 -0700
> > Randy Dunlap <randy.dunlap@oracle.com> wrote:
> >>
> >> Does it even make sense to build hpet_example on s390?
> >> I.e., does s390 have hpet?
> >> If not, then a simple Kconfig "depends on X86" or "depends
> >> on !S390" will fix this.
> > 
> > HPET is very PC specific.
> > 
> > but.. even on x86, it does not really make sense, and exposing this
> > as an interface to userspace is a historical mistake, the use of
> > which we really ought to discourage.
> 
> Do you mean exposing anything that is in /usr/include/linux/hpet.h
> via ioctls? especially struct hpet_info ?

exposing even the concept of HPET, so yeah, including that header.
not all systems have hpet.. and frankly, we have better interfaces for
the same functionality...



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

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

* [PATCH] Documentation/timers/hpet_example.c: only build on X64
  2010-05-28 11:35 Documentation/timers/hpet_example.c compile bug Heiko Carstens
  2010-05-29 18:41 ` Randy Dunlap
@ 2010-06-01  2:30 ` Randy Dunlap
  2010-06-01 15:55   ` Linus Torvalds
  1 sibling, 1 reply; 9+ messages in thread
From: Randy Dunlap @ 2010-06-01  2:30 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: linux-kernel, arjan@infradead.org, Linus Torvalds, Andrew Morton,
	Thomas Gleixner

From: Randy Dunlap <randy.dunlap@oracle.com>

We should only build hpet_example on X64, where it is
implemented.  It can cause build errors on other arch-es.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Arjan van de Ven <arjan@infradead.org>
---
 Documentation/timers/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- lnx-2635-rc1.orig/Documentation/timers/Makefile
+++ lnx-2635-rc1/Documentation/timers/Makefile
@@ -2,7 +2,7 @@
 obj- := dummy.o
 
 # List of programs to build
-hostprogs-y := hpet_example
+hostprogs-$(CONFIG_X86) := hpet_example
 
 # Tell kbuild to always build the programs
 always := $(hostprogs-y)

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

* Re: [PATCH] Documentation/timers/hpet_example.c: only build on X64
  2010-06-01  2:30 ` [PATCH] Documentation/timers/hpet_example.c: only build on X64 Randy Dunlap
@ 2010-06-01 15:55   ` Linus Torvalds
  2010-06-01 16:55     ` [PATCH v2] Documentation/timers/hpet_example.c: only build on X86 Randy Dunlap
  0 siblings, 1 reply; 9+ messages in thread
From: Linus Torvalds @ 2010-06-01 15:55 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Heiko Carstens, linux-kernel, arjan@infradead.org, Andrew Morton,
	Thomas Gleixner



On Mon, 31 May 2010, Randy Dunlap wrote:
> 
> We should only build hpet_example on X64, where it is
> implemented.  It can cause build errors on other arch-es.

Both the subject and the body say "X64" (don't use that, btw, it's x86-64, 
please), but the patch itself says CONFIG_X86.

So what is it? Is it any x86, is it just 64-bit, or what? 

So if it's any x86, then please say so in the explanation. And if it's 
really just x86-64, then use CONFIG_X86_64 as the config variable (and 
x86-64 rather than X64 in the commentary).

			Linus

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

* [PATCH v2] Documentation/timers/hpet_example.c: only build on X86
  2010-06-01 15:55   ` Linus Torvalds
@ 2010-06-01 16:55     ` Randy Dunlap
  0 siblings, 0 replies; 9+ messages in thread
From: Randy Dunlap @ 2010-06-01 16:55 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Heiko Carstens, linux-kernel, arjan@infradead.org, Andrew Morton,
	Thomas Gleixner

From: Randy Dunlap <randy.dunlap@oracle.com>

We should only build hpet_example on (any) X86, where it is
implemented.  It can cause build errors on other arch-es.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Arjan van de Ven <arjan@infradead.org>
---
 Documentation/timers/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- lnx-2635-rc1.orig/Documentation/timers/Makefile
+++ lnx-2635-rc1/Documentation/timers/Makefile
@@ -2,7 +2,7 @@
 obj- := dummy.o
 
 # List of programs to build
-hostprogs-y := hpet_example
+hostprogs-$(CONFIG_X86) := hpet_example
 
 # Tell kbuild to always build the programs
 always := $(hostprogs-y)

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

end of thread, other threads:[~2010-06-01 16:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-28 11:35 Documentation/timers/hpet_example.c compile bug Heiko Carstens
2010-05-29 18:41 ` Randy Dunlap
2010-05-31  2:34   ` Randy Dunlap
2010-05-31  2:49     ` Arjan van de Ven
2010-05-31  2:58       ` Randy Dunlap
2010-05-31  3:10         ` Arjan van de Ven
2010-06-01  2:30 ` [PATCH] Documentation/timers/hpet_example.c: only build on X64 Randy Dunlap
2010-06-01 15:55   ` Linus Torvalds
2010-06-01 16:55     ` [PATCH v2] Documentation/timers/hpet_example.c: only build on X86 Randy Dunlap

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