Skip to contentSkip to conversation

share COMPATIBLE_IOCTL()s across architectures

DISCUSSION Andi Kleen 2 participants 4 messages Mar 19, 2003 – Mar 21, 2003 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andi Kleen

author
#1 lore raw

include/linux/compat_ioctl.h line 5

Quoted 8 lines · Pavel Machek
include/linux/compat_ioctl.h +5 -0
@@ -0,0 +1,641 @@
+/* List here explicitly which ioctl's are known to have
+ * compatible types passed or none at all...
+ */
+/* Big T */
+COMPATIBLE_IOCTL(TCGETA)

Shouldn't you put the include files needed for all that in there too?

Otherwise you have another ugly list to duplicate. The includes cannot be put inside the ioctl list, because in some extreme case they can generate code (e.g. when gcc decides to ignore inline again and emits functions for includes)

It could be done with a special symbol like:

#ifdef DO_INCLUDES
#include foo1
#include foo2
#else
COMPATIBLE_IOCTL(...)
#endif

-Andi

#2 lore raw

Hi!

Quoted 11 lines

include/linux/compat_ioctl.h line 5

Quoted 8 lines
include/linux/compat_ioctl.h +5 -0
@@ -0,0 +1,641 @@
+/* List here explicitly which ioctl's are known to have
+ * compatible types passed or none at all...
+ */
+/* Big T */
+COMPATIBLE_IOCTL(TCGETA)

Shouldn't you put the include files needed for all that in there too?

List of includes is *way* shorter than 600 lines of COMPATIBLE_IOCTL. I prefer to keep it simple for now.
Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
author
#3 lore raw
Quoted 14 lines · Pavel Machek

Hi!

Quoted 11 lines

include/linux/compat_ioctl.h line 5

Quoted 8 lines
include/linux/compat_ioctl.h +5 -0
@@ -0,0 +1,641 @@
+/* List here explicitly which ioctl's are known to have
+ * compatible types passed or none at all...
+ */
+/* Big T */
+COMPATIBLE_IOCTL(TCGETA)

Shouldn't you put the include files needed for all that in there too?

Quoted 2 lines

List of includes is *way* shorter than 600 lines of COMPATIBLE_IOCTL. I prefer to keep it simple for now.

I disagree. The big issue with the duplicated code is not how long it is, but that it needs N changesets to fix something instead of one. Typically a new ioctl also adds a new include.
If you keep the includes separated it'll have even more mainteance overhead than before (you need N+1 commits to add the new ioctl)

-Andi

#4 lore raw

Hi!

Quoted 12 lines
Quoted 12 lines
Quoted 11 lines

include/linux/compat_ioctl.h line 5

Quoted 8 lines
include/linux/compat_ioctl.h +5 -0
@@ -0,0 +1,641 @@
+/* List here explicitly which ioctl's are known to have
+ * compatible types passed or none at all...
+ */
+/* Big T */
+COMPATIBLE_IOCTL(TCGETA)

Shouldn't you put the include files needed for all that in there too?

Quoted 5 lines
Quoted 2 lines

List of includes is *way* shorter than 600 lines of COMPATIBLE_IOCTL. I prefer to keep it simple for now.

I disagree. The big issue with the duplicated code is not how long it is, but that it needs N changesets to fix something instead of one.

Well, there are two of them... 600 lines of duplicated code is great for differences starting to creep in...

Quoted 3 lines

Typically a new ioctl also adds a new include.
If you keep the includes separated it'll have even more mainteance overhead than before (you need N+1 commits to add the new ioctl)

Okay, I'll think what to do with it.
Pavel

Signature · 2 lines
Horseback riding is like software...
...vgf orggre jura vgf serr.