mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-27 06:34:11 +08:00
f24ec7f6c6
Remove w1 comments from crc16.h and move specific constants into w1_ds2433.c where they are used. Replace %d with %zd. Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
31 lines
622 B
C
31 lines
622 B
C
/*
|
|
* crc16.h - CRC-16 routine
|
|
*
|
|
* Implements the standard CRC-16:
|
|
* Width 16
|
|
* Poly 0x8005 (x^16 + x^15 + x^2 + 1)
|
|
* Init 0
|
|
*
|
|
* Copyright (c) 2005 Ben Gardner <bgardner@wabtec.com>
|
|
*
|
|
* This source code is licensed under the GNU General Public License,
|
|
* Version 2. See the file COPYING for more details.
|
|
*/
|
|
|
|
#ifndef __CRC16_H
|
|
#define __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 data)
|
|
{
|
|
return (crc >> 8) ^ crc16_table[(crc ^ data) & 0xff];
|
|
}
|
|
|
|
#endif /* __CRC16_H */
|
|
|