From: Jens Axboe Date: Sat, 1 Oct 2011 04:49:30 +0000 (-0600) Subject: crc16: use void * as the argument X-Git-Tag: fio-1.99~80 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=3095ffa9747a679e4f655388c782e4b201047fd3 crc16: use void * as the argument Signed-off-by: Jens Axboe --- diff --git a/crc/crc16.c b/crc/crc16.c index ac7983a2..d9c4e491 100644 --- a/crc/crc16.c +++ b/crc/crc16.c @@ -43,11 +43,12 @@ unsigned short const crc16_table[256] = { 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040 }; -unsigned short crc16(unsigned char const *buffer, unsigned int len) +unsigned short crc16(const void *buffer, unsigned int len) { + const unsigned char *cp = (const unsigned char *) buffer; unsigned short crc = 0; while (len--) - crc = crc16_byte(crc, *buffer++); + crc = crc16_byte(crc, *cp++); return crc; } diff --git a/crc/crc16.h b/crc/crc16.h index 841378d4..6c078a4e 100644 --- a/crc/crc16.h +++ b/crc/crc16.h @@ -17,7 +17,7 @@ extern unsigned short const crc16_table[256]; -extern unsigned short crc16(const unsigned char *buffer, unsigned int len); +extern unsigned short crc16(const void *buffer, unsigned int len); static inline unsigned short crc16_byte(unsigned short crc, const unsigned char data)