diff options
author | Randy Dunlap <rdunlap@infradead.org> | 2017-09-08 19:35:55 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2017-09-26 17:01:20 -0400 |
commit | 8a29896a6e31c7aa2ca3b50d8aefe05f280b0b7e (patch) | |
tree | 8ef874d134297f6543ec7498739958b709aa44d4 /lib/crc8.c | |
parent | 44e9f099367716dde33618b7d5d25c3123437ba6 (diff) |
docs: clean up and add rest of CRC functions to kernel-api.rst
Add the rest of the CRC library functions to kernel-api.
- try to clarify crc32() by adding '@' to a function parameter
- reorder kernel-api CRC functions to be less random
- add more CRC functions to kernel-api
- correct the function parameter names in several places
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'lib/crc8.c')
-rw-r--r-- | lib/crc8.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/crc8.c b/lib/crc8.c index 87b59cafdb83..595a5a75e3cd 100644 --- a/lib/crc8.c +++ b/lib/crc8.c | |||
@@ -20,11 +20,11 @@ | |||
20 | #include <linux/crc8.h> | 20 | #include <linux/crc8.h> |
21 | #include <linux/printk.h> | 21 | #include <linux/printk.h> |
22 | 22 | ||
23 | /* | 23 | /** |
24 | * crc8_populate_msb - fill crc table for given polynomial in reverse bit order. | 24 | * crc8_populate_msb - fill crc table for given polynomial in reverse bit order. |
25 | * | 25 | * |
26 | * table: table to be filled. | 26 | * @table: table to be filled. |
27 | * polynomial: polynomial for which table is to be filled. | 27 | * @polynomial: polynomial for which table is to be filled. |
28 | */ | 28 | */ |
29 | void crc8_populate_msb(u8 table[CRC8_TABLE_SIZE], u8 polynomial) | 29 | void crc8_populate_msb(u8 table[CRC8_TABLE_SIZE], u8 polynomial) |
30 | { | 30 | { |
@@ -42,11 +42,11 @@ void crc8_populate_msb(u8 table[CRC8_TABLE_SIZE], u8 polynomial) | |||
42 | } | 42 | } |
43 | EXPORT_SYMBOL(crc8_populate_msb); | 43 | EXPORT_SYMBOL(crc8_populate_msb); |
44 | 44 | ||
45 | /* | 45 | /** |
46 | * crc8_populate_lsb - fill crc table for given polynomial in regular bit order. | 46 | * crc8_populate_lsb - fill crc table for given polynomial in regular bit order. |
47 | * | 47 | * |
48 | * table: table to be filled. | 48 | * @table: table to be filled. |
49 | * polynomial: polynomial for which table is to be filled. | 49 | * @polynomial: polynomial for which table is to be filled. |
50 | */ | 50 | */ |
51 | void crc8_populate_lsb(u8 table[CRC8_TABLE_SIZE], u8 polynomial) | 51 | void crc8_populate_lsb(u8 table[CRC8_TABLE_SIZE], u8 polynomial) |
52 | { | 52 | { |
@@ -63,13 +63,13 @@ void crc8_populate_lsb(u8 table[CRC8_TABLE_SIZE], u8 polynomial) | |||
63 | } | 63 | } |
64 | EXPORT_SYMBOL(crc8_populate_lsb); | 64 | EXPORT_SYMBOL(crc8_populate_lsb); |
65 | 65 | ||
66 | /* | 66 | /** |
67 | * crc8 - calculate a crc8 over the given input data. | 67 | * crc8 - calculate a crc8 over the given input data. |
68 | * | 68 | * |
69 | * table: crc table used for calculation. | 69 | * @table: crc table used for calculation. |
70 | * pdata: pointer to data buffer. | 70 | * @pdata: pointer to data buffer. |
71 | * nbytes: number of bytes in data buffer. | 71 | * @nbytes: number of bytes in data buffer. |
72 | * crc: previous returned crc8 value. | 72 | * @crc: previous returned crc8 value. |
73 | */ | 73 | */ |
74 | u8 crc8(const u8 table[CRC8_TABLE_SIZE], u8 *pdata, size_t nbytes, u8 crc) | 74 | u8 crc8(const u8 table[CRC8_TABLE_SIZE], u8 *pdata, size_t nbytes, u8 crc) |
75 | { | 75 | { |