* [PATCH] fix for userspace usage of include/linux/crc-ccitt.h in 2.6.9-rc1
@ 2004-08-28 18:12 Giacomo Lozito
0 siblings, 0 replies; only message in thread
From: Giacomo Lozito @ 2004-08-28 18:12 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 389 bytes --]
This patch solves the issue described in this post:
http://lkml.org/lkml/2004/8/26/119
by using __u16 and __u8 in place of u16 and u8, that aren't exported outside
the kernel.
If it's really trivial to use u16 and u8 for crc-ccitt.h, another way of
solving this could be to use #ifdef __KERNEL__
in crc-ccitt.h to separate userspace usage from kernel matters.
Regards,
Giacomo Lozito
[-- Attachment #2: crc-ccitt.h.2.6.9-rc1.userspace.patch --]
[-- Type: text/x-diff, Size: 579 bytes --]
--- a/include/linux/crc-ccitt.h 2004-08-28 19:40:39.000000000 +0200
+++ b/include/linux/crc-ccitt.h 2004-08-28 19:38:10.000000000 +0200
@@ -3,11 +3,11 @@
#include <linux/types.h>
-extern u16 const crc_ccitt_table[256];
+extern __u16 const crc_ccitt_table[256];
-extern u16 crc_ccitt(u16 crc, const u8 *buffer, size_t len);
+extern __u16 crc_ccitt(__u16 crc, const __u8 *buffer, size_t len);
-static inline u16 crc_ccitt_byte(u16 crc, const u8 c)
+static inline __u16 crc_ccitt_byte(__u16 crc, const __u8 c)
{
return (crc >> 8) ^ crc_ccitt_table[(crc ^ c) & 0xff];
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-08-28 18:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-28 18:12 [PATCH] fix for userspace usage of include/linux/crc-ccitt.h in 2.6.9-rc1 Giacomo Lozito
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.