Skip to contentSkip to conversation

Drop an empty byteorder/generic.h from being exported to userspace.

PATCH In review Robert P. J. Day 2 participants 5 messages Apr 2, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Drop an empty byteorder/generic.h from being exported to userspace.

Since the entire meaningful contents of generic.h is wrapped by the __KERNEL__ test, drop it from being passed to userspace, and remove the now superfluous __KERNEL__ test.

---

is there some value in allowing an effectively empty header file to
be exported to userspace?

 include/linux/byteorder/Kbuild    |    1 -
 include/linux/byteorder/generic.h |    8 --------
 2 files changed, 9 deletions(-)
include/linux/byteorder/Kbuild +0 -1
index 79beddd..a50614c 100644
@@ -1,5 +1,4 @@
 header-y += big_endian.h
 header-y += little_endian.h
 
-unifdef-y += generic.h
 unifdef-y += swab.h
include/linux/byteorder/generic.h +0 -8
index d377155..0846e6b 100644
@@ -82,12 +82,6 @@
  *
  */
 
-
-#if defined(__KERNEL__)
-/*
- * inside the kernel, we can use nicknames;
- * outside of it, we must avoid POSIX namespace pollution...
- */
 #define cpu_to_le64 __cpu_to_le64
 #define le64_to_cpu __le64_to_cpu
 #define cpu_to_le32 __cpu_to_le32
@@ -176,6 +170,4 @@ static inline void be64_add_cpu(__be64 *var, u64 val)
 	*var = cpu_to_be64(be64_to_cpu(*var) + val);
 }
 
-#endif /* KERNEL */
-
 #endif /* _LINUX_BYTEORDER_GENERIC_H */

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.

http://crashcourse.ca Waterloo, Ontario, CANADA
========================================================================

#1 lore raw
Quoted 10 lines · Robert P. J. Day

Since the entire meaningful contents of generic.h is wrapped by the __KERNEL__ test, drop it from being passed to userspace, and remove the now superfluous __KERNEL__ test.

---

is there some value in allowing an effectively empty header file to
be exported to userspace?

Not breaking the userspace? The file is included in non-__KERNEL__ sections from byteorder/*_endian.h.

#2 lore raw
Quoted 7 lines · Jiri Slaby
Quoted 6 lines · Robert P. J. Day

Since the entire meaningful contents of generic.h is wrapped by the __KERNEL__ test, drop it from being passed to userspace, and remove the now superfluous __KERNEL__ test.

Quoted 7 lines
Quoted 4 lines

---

is there some value in allowing an effectively empty header file to
be exported to userspace?

Not breaking the userspace? The file is included in non-__KERNEL__ sections from byteorder/*_endian.h.

ok ... and the value of including a completely empty header file is ... ?

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.

http://crashcourse.ca Waterloo, Ontario, CANADA
========================================================================

#3 lore raw
Quoted 11 lines · Robert P. J. Day
Quoted 9 lines · Jiri Slaby
Quoted 8 lines · Robert P. J. Day

Since the entire meaningful contents of generic.h is wrapped by the __KERNEL__ test, drop it from being passed to userspace, and remove the now superfluous __KERNEL__ test.

---

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

is there some value in allowing an effectively empty header file to
be exported to userspace?

Not breaking the userspace? The file is included in non-__KERNEL__ sections from byteorder/*_endian.h.

ok ... and the value of including a completely empty header file is ... ?

No value, you should just move those includes into the __KERNEL__ part.

#4 lore raw
Quoted 14 lines · Jiri Slaby
Quoted 13 lines · Robert P. J. Day
Quoted 11 lines · Jiri Slaby
Quoted 10 lines · Robert P. J. Day

Since the entire meaningful contents of generic.h is wrapped by the __KERNEL__ test, drop it from being passed to userspace, and remove the now superfluous __KERNEL__ test.

---

is there some value in allowing an effectively empty header file to
be exported to userspace?

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Not breaking the userspace? The file is included in non-__KERNEL__ sections from byteorder/*_endian.h.

ok ... and the value of including a completely empty header file is ... ?

No value, you should just move those includes into the __KERNEL__ part.

gotcha, that's what i'd concluded after your earlier post, i just wasn't sure if there was something more subtle happening here. revised patch coming soon. thanks.

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.

http://crashcourse.ca Waterloo, Ontario, CANADA
========================================================================