All of lore.kernel.org
 help / color / mirror / Atom feed
* Why get/put_unaligned are hidden behind #ifdef __KERNEL__ on PowerPC and Microblaze?
@ 2010-10-31 15:13 Igor Zhbanov
  2010-10-31 15:27 ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Igor Zhbanov @ 2010-10-31 15:13 UTC (permalink / raw)
  To: linux-kernel

Hello!

I have found that functions get_unaligned and put_unaligned from unaligned.h
are hidden behind #ifdef __KERNEL__ on PowerPC and Microblaze architectures.
And are not hidden on other platforms. But why?
I think that these functions are very useful in user space.

So here is the patch:

diff -purN -U 5 linux-2.6.36/arch/microblaze/include/asm/unaligned.h
linux/arch/microblaze/include/asm/unaligned.h
--- linux-2.6.36/arch/microblaze/include/asm/unaligned.h	2010-10-21
00:30:22.000000000 +0400
+++ linux/arch/microblaze/include/asm/unaligned.h	2010-10-31
18:05:31.513345000 +0300
@@ -8,16 +8,13 @@
  */

 #ifndef _ASM_MICROBLAZE_UNALIGNED_H
 #define _ASM_MICROBLAZE_UNALIGNED_H

-# ifdef __KERNEL__
-
 # include <linux/unaligned/be_struct.h>
 # include <linux/unaligned/le_byteshift.h>
 # include <linux/unaligned/generic.h>

 # define get_unaligned	__get_unaligned_be
 # define put_unaligned	__put_unaligned_be

-# endif	/* __KERNEL__ */
 #endif /* _ASM_MICROBLAZE_UNALIGNED_H */
diff -purN -U 5 linux-2.6.36/arch/powerpc/include/asm/unaligned.h
linux/arch/powerpc/include/asm/unaligned.h
--- linux-2.6.36/arch/powerpc/include/asm/unaligned.h	2010-10-21
00:30:22.000000000 +0400
+++ linux/arch/powerpc/include/asm/unaligned.h	2010-10-31
18:05:43.968057400 +0300
@@ -1,16 +1,13 @@
 #ifndef _ASM_POWERPC_UNALIGNED_H
 #define _ASM_POWERPC_UNALIGNED_H

-#ifdef __KERNEL__
-
 /*
  * The PowerPC can do unaligned accesses itself in big endian mode.
  */
 #include <linux/unaligned/access_ok.h>
 #include <linux/unaligned/generic.h>

 #define get_unaligned	__get_unaligned_be
 #define put_unaligned	__put_unaligned_be

-#endif	/* __KERNEL__ */
 #endif	/* _ASM_POWERPC_UNALIGNED_H */

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

end of thread, other threads:[~2010-10-31 17:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-31 15:13 Why get/put_unaligned are hidden behind #ifdef __KERNEL__ on PowerPC and Microblaze? Igor Zhbanov
2010-10-31 15:27 ` Andreas Schwab
2010-10-31 16:10   ` Igor Zhbanov
2010-10-31 17:45     ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.