diff options
| author | Andrey Panin <pazke@donpac.ru> | 2004-07-10 19:35:39 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-07-10 19:35:39 -0700 |
| commit | 3664d16904b5928d282074ac9b70b16fab534a14 (patch) | |
| tree | 47a627a24da3b1ac50508b8496bbd3846b520422 /include/linux | |
| parent | 161cd3dd77b58b5a9f68547750d6f2d529b906ca (diff) | |
[PATCH] fix CRC16 misnaming
As pointed by Thomas Sailer, crc16.c module contains CRC16-CCITT (x^16 + x^12
+ x^5 + 1) implementation, not IBM CRC16 (x^16 + x^15 + x^2 + 1) one. Looks
like we need to rename it accordingly and this patchset does exactly this.
Signed-off-by: Andrey Panin <pazke@donpac.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/crc-ccitt.h | 15 | ||||
| -rw-r--r-- | include/linux/crc16.h | 15 |
2 files changed, 15 insertions, 15 deletions
diff --git a/include/linux/crc-ccitt.h b/include/linux/crc-ccitt.h new file mode 100644 index 000000000000..f52696a1ff0d --- /dev/null +++ b/include/linux/crc-ccitt.h @@ -0,0 +1,15 @@ +#ifndef _LINUX_CRC_CCITT_H +#define _LINUX_CRC_CCITT_H + +#include <linux/types.h> + +extern u16 const crc_ccitt_table[256]; + +extern u16 crc_ccitt(u16 crc, const u8 *buffer, size_t len); + +static inline u16 crc_ccitt_byte(u16 crc, const u8 c) +{ + return (crc >> 8) ^ crc_ccitt_table[(crc ^ c) & 0xff]; +} + +#endif /* _LINUX_CRC_CCITT_H */ diff --git a/include/linux/crc16.h b/include/linux/crc16.h deleted file mode 100644 index a077021e1c38..000000000000 --- a/include/linux/crc16.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _LINUX_CRC16_H -#define _LINUX_CRC16_H - -#include <linux/types.h> - -extern u16 const crc16_table[256]; - -extern u16 crc16(u16 crc, const u8 *buffer, size_t len); - -static inline u16 crc16_byte(u16 crc, const u8 c) -{ - return (crc >> 8) ^ crc16_table[(crc ^ c) & 0xff]; -} - -#endif /* _LINUX_CRC16_H */ |
