Skip to content

2.6.7-mm6, fix CRC16 misnaming

Andrey Panin lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/52.6.7-mm6, CRC16 renaming in AX25 driversdrivers/net/hamradio/baycom_epp.c drivers/net/hamradio/hdlcdrv.c+6 -60 replies
2/52.6.7-mm6, CRC16 renaming in IRDA driversinclude/net/irda/crc.h+3 -30 replies
3/52.6.7-mm6, CRC16 renaming in ISDN driversdrivers/isdn/hisax/isdnhdlc.c drivers/isdn/hisax/st5481_hdlc.c drivers/isdn/tpam/tpam_crcpc.c+10 -100 replies
4/52.6.7-mm6, CRC16 renaming in PPP driverdrivers/net/ppp_async.c include/linux/ppp_defs.h+3 -30 replies
5/52.6.7-mm6, CRC16 renaming in VIA Velocity ethernet driverdrivers/net/via-velocity.c+2 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] 2.6.7-mm6, 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.

Please consider applying.

 include/linux/crc-ccitt.h |   15 ++++++++++
 include/linux/crc16.h     |   15 ----------
 lib/Kconfig               |   10 +++---
 lib/Makefile              |    2 -
 lib/crc-ccitt.c           |   69 ++++++++++++++++++++++++++++++++++++++++++++++
 lib/crc16.c               |   69 ----------------------------------------------
 6 files changed, 90 insertions(+), 90 deletions(-)
lib/Kconfig +5 -5
diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/lib/Kconfig linux-2.6.7-mm5/lib/Kconfig
@@ -4,13 +4,13 @@
 
 menu "Library routines"
 
-config CRC16
-	tristate "CRC16 functions"
+config CRC_CCITT
+	tristate "CRC-CCITT functions"
 	help
 	  This option is provided for the case where no in-kernel-tree
-	  modules require CRC16 functions, but a module built outside the
-	  kernel tree does. Such modules that use library CRC16 functions
-	  require M here.
+	  modules require CRC-CCITT functions, but a module built outside
+	  the kernel tree does. Such modules that use library CRC-CCITT
+	  functions require M here.
 
 config CRC32
 	tristate "CRC32 functions"
lib/Makefile +1 -1
diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/lib/Makefile linux-2.6.7-mm5/lib/Makefile
@@ -18,7 +18,7 @@ ifneq ($(CONFIG_HAVE_DEC_LOCK),y) 
   lib-y += dec_and_lock.o
 endif
 
-obj-$(CONFIG_CRC16)	+= crc16.o
+obj-$(CONFIG_CRC_CCITT)	+= crc-ccitt.o
 obj-$(CONFIG_CRC32)	+= crc32.o
 obj-$(CONFIG_LIBCRC32C)	+= libcrc32c.o
 
lib/crc-ccitt.c +69 -0

69 lines not on this page · raw message

lib/crc16.c +0 -69

69 lines not on this page · raw message

include/linux/crc-ccitt.h +15 -0
diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/include/linux/crc-ccitt.h linux-2.6.7-mm5/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 */
include/linux/crc16.h +0 -15
diff -urpN -X /usr/share/dontdiff linux-2.6.7-mm5.vanilla/include/linux/crc16.h linux-2.6.7-mm5/include/linux/crc16.h
@@ -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 */