Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] kernel-doc for lib/crc*.c

Make kernel-doc corrections & additions to lib/crc*.c. Add crc functions to
kernel-api.tmpl in DocBook.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Randy Dunlap and committed by
Linus Torvalds
2f72100c 28e83baa

+36 -40
+6
Documentation/DocBook/kernel-api.tmpl
··· 129 129 <sect1><title>Command-line Parsing</title> 130 130 !Elib/cmdline.c 131 131 </sect1> 132 + 133 + <sect1><title>CRC Functions</title> 134 + !Elib/crc16.c 135 + !Elib/crc32.c 136 + !Elib/crc-ccitt.c 137 + </sect1> 132 138 </chapter> 133 139 134 140 <chapter id="mm">
+3 -3
lib/crc-ccitt.c
··· 53 53 54 54 /** 55 55 * crc_ccitt - recompute the CRC for the data buffer 56 - * @crc - previous CRC value 57 - * @buffer - data pointer 58 - * @len - number of bytes in the buffer 56 + * @crc: previous CRC value 57 + * @buffer: data pointer 58 + * @len: number of bytes in the buffer 59 59 */ 60 60 u16 crc_ccitt(u16 crc, u8 const *buffer, size_t len) 61 61 {
+5 -5
lib/crc16.c
··· 47 47 EXPORT_SYMBOL(crc16_table); 48 48 49 49 /** 50 - * Compute the CRC-16 for the data buffer 50 + * crc16 - compute the CRC-16 for the data buffer 51 + * @crc: previous CRC value 52 + * @buffer: data pointer 53 + * @len: number of bytes in the buffer 51 54 * 52 - * @param crc previous CRC value 53 - * @param buffer data pointer 54 - * @param len number of bytes in the buffer 55 - * @return the updated CRC value 55 + * Returns the updated CRC value. 56 56 */ 57 57 u16 crc16(u16 crc, u8 const *buffer, size_t len) 58 58 {
+22 -32
lib/crc32.c
··· 42 42 MODULE_DESCRIPTION("Ethernet CRC32 calculations"); 43 43 MODULE_LICENSE("GPL"); 44 44 45 + /** 46 + * crc32_le() - Calculate bitwise little-endian Ethernet AUTODIN II CRC32 47 + * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for 48 + * other uses, or the previous crc32 value if computing incrementally. 49 + * @p: pointer to buffer over which CRC is run 50 + * @len: length of buffer @p 51 + */ 52 + u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len); 53 + 45 54 #if CRC_LE_BITS == 1 46 55 /* 47 56 * In fact, the table-based code will work in this case, but it can be 48 57 * simplified by inlining the table in ?: form. 49 58 */ 50 59 51 - /** 52 - * crc32_le() - Calculate bitwise little-endian Ethernet AUTODIN II CRC32 53 - * @crc - seed value for computation. ~0 for Ethernet, sometimes 0 for 54 - * other uses, or the previous crc32 value if computing incrementally. 55 - * @p - pointer to buffer over which CRC is run 56 - * @len - length of buffer @p 57 - * 58 - */ 59 60 u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) 60 61 { 61 62 int i; ··· 69 68 } 70 69 #else /* Table-based approach */ 71 70 72 - /** 73 - * crc32_le() - Calculate bitwise little-endian Ethernet AUTODIN II CRC32 74 - * @crc - seed value for computation. ~0 for Ethernet, sometimes 0 for 75 - * other uses, or the previous crc32 value if computing incrementally. 76 - * @p - pointer to buffer over which CRC is run 77 - * @len - length of buffer @p 78 - * 79 - */ 80 71 u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) 81 72 { 82 73 # if CRC_LE_BITS == 8 ··· 138 145 } 139 146 #endif 140 147 148 + /** 149 + * crc32_be() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32 150 + * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for 151 + * other uses, or the previous crc32 value if computing incrementally. 152 + * @p: pointer to buffer over which CRC is run 153 + * @len: length of buffer @p 154 + */ 155 + u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len); 156 + 141 157 #if CRC_BE_BITS == 1 142 158 /* 143 159 * In fact, the table-based code will work in this case, but it can be 144 160 * simplified by inlining the table in ?: form. 145 161 */ 146 162 147 - /** 148 - * crc32_be() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32 149 - * @crc - seed value for computation. ~0 for Ethernet, sometimes 0 for 150 - * other uses, or the previous crc32 value if computing incrementally. 151 - * @p - pointer to buffer over which CRC is run 152 - * @len - length of buffer @p 153 - * 154 - */ 155 163 u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) 156 164 { 157 165 int i; ··· 167 173 } 168 174 169 175 #else /* Table-based approach */ 170 - /** 171 - * crc32_be() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32 172 - * @crc - seed value for computation. ~0 for Ethernet, sometimes 0 for 173 - * other uses, or the previous crc32 value if computing incrementally. 174 - * @p - pointer to buffer over which CRC is run 175 - * @len - length of buffer @p 176 - * 177 - */ 178 176 u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) 179 177 { 180 178 # if CRC_BE_BITS == 8 ··· 235 249 } 236 250 #endif 237 251 252 + /** 253 + * bitreverse - reverse the order of bits in a u32 value 254 + * @x: value to be bit-reversed 255 + */ 238 256 u32 bitreverse(u32 x) 239 257 { 240 258 x = (x >> 16) | (x << 16);