diff options
author | Randy Dunlap <rdunlap@xenotime.net> | 2006-06-25 08:48:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:01:20 -0400 |
commit | 2f72100c01dd31d769097c58874e8ab1e70b2518 (patch) | |
tree | e8f654f519f56ac37de88533e3d93a3e80cb6454 /lib | |
parent | 28e83baac20e3fe624af89a55eb06c2a7cab6828 (diff) |
[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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/crc-ccitt.c | 6 | ||||
-rw-r--r-- | lib/crc16.c | 10 | ||||
-rw-r--r-- | lib/crc32.c | 54 |
3 files changed, 30 insertions, 40 deletions
diff --git a/lib/crc-ccitt.c b/lib/crc-ccitt.c index 115d149af407..7f6dd68d2d09 100644 --- a/lib/crc-ccitt.c +++ b/lib/crc-ccitt.c | |||
@@ -53,9 +53,9 @@ EXPORT_SYMBOL(crc_ccitt_table); | |||
53 | 53 | ||
54 | /** | 54 | /** |
55 | * crc_ccitt - recompute the CRC for the data buffer | 55 | * crc_ccitt - recompute the CRC for the data buffer |
56 | * @crc - previous CRC value | 56 | * @crc: previous CRC value |
57 | * @buffer - data pointer | 57 | * @buffer: data pointer |
58 | * @len - number of bytes in the buffer | 58 | * @len: number of bytes in the buffer |
59 | */ | 59 | */ |
60 | u16 crc_ccitt(u16 crc, u8 const *buffer, size_t len) | 60 | u16 crc_ccitt(u16 crc, u8 const *buffer, size_t len) |
61 | { | 61 | { |
diff --git a/lib/crc16.c b/lib/crc16.c index 011fe573c666..8737b084d1f9 100644 --- a/lib/crc16.c +++ b/lib/crc16.c | |||
@@ -47,12 +47,12 @@ u16 const crc16_table[256] = { | |||
47 | EXPORT_SYMBOL(crc16_table); | 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 | 55 | * Returns the updated CRC value. |
53 | * @param buffer data pointer | ||
54 | * @param len number of bytes in the buffer | ||
55 | * @return the updated CRC value | ||
56 | */ | 56 | */ |
57 | u16 crc16(u16 crc, u8 const *buffer, size_t len) | 57 | u16 crc16(u16 crc, u8 const *buffer, size_t len) |
58 | { | 58 | { |
diff --git a/lib/crc32.c b/lib/crc32.c index 065198f98b3f..285fd9bc61be 100644 --- a/lib/crc32.c +++ b/lib/crc32.c | |||
@@ -42,20 +42,21 @@ MODULE_AUTHOR("Matt Domsch <Matt_Domsch@dell.com>"); | |||
42 | MODULE_DESCRIPTION("Ethernet CRC32 calculations"); | 42 | MODULE_DESCRIPTION("Ethernet CRC32 calculations"); |
43 | MODULE_LICENSE("GPL"); | 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 | #if CRC_LE_BITS == 1 | 54 | #if CRC_LE_BITS == 1 |
46 | /* | 55 | /* |
47 | * In fact, the table-based code will work in this case, but it can be | 56 | * In fact, the table-based code will work in this case, but it can be |
48 | * simplified by inlining the table in ?: form. | 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 | u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) | 60 | u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) |
60 | { | 61 | { |
61 | int i; | 62 | int i; |
@@ -68,14 +69,6 @@ u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) | |||
68 | } | 69 | } |
69 | #else /* Table-based approach */ | 70 | #else /* Table-based approach */ |
70 | 71 | ||
71 | /** | ||
72 | * crc32_le() - Calculate bitwise little-endian Ethernet AUTODIN II CRC32 | ||
73 | * @crc - seed value for computation. ~0 for Ethernet, sometimes 0 for | ||
74 | * other uses, or the previous crc32 value if computing incrementally. | ||
75 | * @p - pointer to buffer over which CRC is run | ||
76 | * @len - length of buffer @p | ||
77 | * | ||
78 | */ | ||
79 | u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) | 72 | u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) |
80 | { | 73 | { |
81 | # if CRC_LE_BITS == 8 | 74 | # if CRC_LE_BITS == 8 |
@@ -145,20 +138,21 @@ u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) | |||
145 | } | 138 | } |
146 | #endif | 139 | #endif |
147 | 140 | ||
141 | /** | ||
142 | * crc32_be() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32 | ||
143 | * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for | ||
144 | * other uses, or the previous crc32 value if computing incrementally. | ||
145 | * @p: pointer to buffer over which CRC is run | ||
146 | * @len: length of buffer @p | ||
147 | */ | ||
148 | u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len); | ||
149 | |||
148 | #if CRC_BE_BITS == 1 | 150 | #if CRC_BE_BITS == 1 |
149 | /* | 151 | /* |
150 | * In fact, the table-based code will work in this case, but it can be | 152 | * In fact, the table-based code will work in this case, but it can be |
151 | * simplified by inlining the table in ?: form. | 153 | * simplified by inlining the table in ?: form. |
152 | */ | 154 | */ |
153 | 155 | ||
154 | /** | ||
155 | * crc32_be() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32 | ||
156 | * @crc - seed value for computation. ~0 for Ethernet, sometimes 0 for | ||
157 | * other uses, or the previous crc32 value if computing incrementally. | ||
158 | * @p - pointer to buffer over which CRC is run | ||
159 | * @len - length of buffer @p | ||
160 | * | ||
161 | */ | ||
162 | u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) | 156 | u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) |
163 | { | 157 | { |
164 | int i; | 158 | int i; |
@@ -173,14 +167,6 @@ u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) | |||
173 | } | 167 | } |
174 | 168 | ||
175 | #else /* Table-based approach */ | 169 | #else /* Table-based approach */ |
176 | /** | ||
177 | * crc32_be() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32 | ||
178 | * @crc - seed value for computation. ~0 for Ethernet, sometimes 0 for | ||
179 | * other uses, or the previous crc32 value if computing incrementally. | ||
180 | * @p - pointer to buffer over which CRC is run | ||
181 | * @len - length of buffer @p | ||
182 | * | ||
183 | */ | ||
184 | u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) | 170 | u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) |
185 | { | 171 | { |
186 | # if CRC_BE_BITS == 8 | 172 | # if CRC_BE_BITS == 8 |
@@ -249,6 +235,10 @@ u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) | |||
249 | } | 235 | } |
250 | #endif | 236 | #endif |
251 | 237 | ||
238 | /** | ||
239 | * bitreverse - reverse the order of bits in a u32 value | ||
240 | * @x: value to be bit-reversed | ||
241 | */ | ||
252 | u32 bitreverse(u32 x) | 242 | u32 bitreverse(u32 x) |
253 | { | 243 | { |
254 | x = (x >> 16) | (x << 16); | 244 | x = (x >> 16) | (x << 16); |