summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.cirrus.com>2021-05-06 18:03:37 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-05-06 19:24:12 -0700
commite18baa7cc3598999317d6c2fe255756f6b3b7562 (patch)
tree8384513fa290cba884373e3963ae79abe4735029 /include
parentade29d4fdbe675d72ee6115baaf3b3382942fd12 (diff)
lib: crc8: pointer to data block should be const
crc8() does not change the data passed to it, so the pointer argument should be declared const. This avoids callers that receive const data having to cast it to a non-const pointer to call crc8(). Link: https://lkml.kernel.org/r/20210329122409.3291-1-rf@opensource.cirrus.com Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/crc8.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/crc8.h b/include/linux/crc8.h
index 13c8dabb0441..674045c59a04 100644
--- a/include/linux/crc8.h
+++ b/include/linux/crc8.h
@@ -96,6 +96,6 @@ void crc8_populate_msb(u8 table[CRC8_TABLE_SIZE], u8 polynomial);
* Williams, Ross N., ross<at>ross.net
* (see URL http://www.ross.net/crc/download/crc_v3.txt).
*/
-u8 crc8(const u8 table[CRC8_TABLE_SIZE], u8 *pdata, size_t nbytes, u8 crc);
+u8 crc8(const u8 table[CRC8_TABLE_SIZE], const u8 *pdata, size_t nbytes, u8 crc);
#endif /* __CRC8_H_ */