mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-22 00:40:03 +00:00
![George Spelvin](/assets/img/avatar_default.png)
This eliminates a 1-bit left shift in every single caller, and makes the inner loop of the CRC computation more efficient. Renamed crc7 to crc7_be (big-endian) since the interface changed. Also purged #include <linux/crc7.h> from files that don't use it at all. Signed-off-by: George Spelvin <linux@horizon.com> Reviewed-by: Pavel Machek <pavel@ucw.cz> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 lines
277 B
C
14 lines
277 B
C
#ifndef _LINUX_CRC7_H
|
|
#define _LINUX_CRC7_H
|
|
#include <linux/types.h>
|
|
|
|
extern const u8 crc7_be_syndrome_table[256];
|
|
|
|
static inline u8 crc7_be_byte(u8 crc, u8 data)
|
|
{
|
|
return crc7_be_syndrome_table[crc ^ data];
|
|
}
|
|
|
|
extern u8 crc7_be(u8 crc, const u8 *buffer, size_t len);
|
|
|
|
#endif
|