[PATCH] fix for userspace usage of include/linux/crc-ccitt.h in 2.6.9-rc1

From: Giacomo Lozito
Date: Sat Aug 28 2004 - 13:12:00 EST



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
--- 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];
}