diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-04-06 20:55:10 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-04-06 20:55:10 +0200 |
commit | a48f831d12934a5c001c68f4bb4dafa8c78e3feb (patch) | |
tree | fba1b2be0e6ee6786f7ab8ab191a0091b19fd0e5 /include | |
parent | aa45c51b965d907ab79f777500e616338fe7de31 (diff) | |
parent | 1c8dc624f53580df32794c6f4a9a3d5030f892c3 (diff) | |
download | barebox-a48f831d12934a5c001c68f4bb4dafa8c78e3feb.tar.gz barebox-a48f831d12934a5c001c68f4bb4dafa8c78e3feb.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'include')
-rw-r--r-- | include/aiodev.h | 2 | ||||
-rw-r--r-- | include/linux/crc-ccitt.h | 23 |
2 files changed, 24 insertions, 1 deletions
diff --git a/include/aiodev.h b/include/aiodev.h index 0d4f7a2940..5e38b4fab5 100644 --- a/include/aiodev.h +++ b/include/aiodev.h @@ -23,7 +23,7 @@ struct aiodevice; struct aiochannel { int index; - char *unit; + const char *unit; struct aiodevice *aiodev; int value; diff --git a/include/linux/crc-ccitt.h b/include/linux/crc-ccitt.h new file mode 100644 index 0000000000..72c92c396b --- /dev/null +++ b/include/linux/crc-ccitt.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_CRC_CCITT_H +#define _LINUX_CRC_CCITT_H + +#include <linux/types.h> + +extern u16 const crc_ccitt_table[256]; +extern u16 const crc_ccitt_false_table[256]; + +extern u16 crc_ccitt(u16 crc, const u8 *buffer, size_t len); +extern u16 crc_ccitt_false(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]; +} + +static inline u16 crc_ccitt_false_byte(u16 crc, const u8 c) +{ + return (crc << 8) ^ crc_ccitt_false_table[(crc >> 8) ^ c]; +} + +#endif /* _LINUX_CRC_CCITT_H */ |