All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] docs: clean up and add rest of CRC functions to kernel-api.rst
@ 2017-09-08 23:35 Randy Dunlap
  2017-09-26 21:02 ` Jonathan Corbet
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2017-09-08 23:35 UTC (permalink / raw)
  To: linux-doc, Jonathan Corbet; +Cc: LKML

From: Randy Dunlap <rdunlap@infradead.org>

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>
---
 Documentation/core-api/kernel-api.rst |   10 ++++++++--
 lib/crc32.c                           |    2 +-
 lib/crc4.c                            |    2 +-
 lib/crc8.c                            |   22 +++++++++++-----------
 4 files changed, 21 insertions(+), 15 deletions(-)

--- lnx-413.orig/Documentation/core-api/kernel-api.rst
+++ lnx-413/Documentation/core-api/kernel-api.rst
@@ -70,13 +70,16 @@ Command-line Parsing
 CRC Functions
 -------------
 
+.. kernel-doc:: lib/crc4.c
+   :export:
+
 .. kernel-doc:: lib/crc7.c
    :export:
 
-.. kernel-doc:: lib/crc16.c
+.. kernel-doc:: lib/crc8.c
    :export:
 
-.. kernel-doc:: lib/crc-itu-t.c
+.. kernel-doc:: lib/crc16.c
    :export:
 
 .. kernel-doc:: lib/crc32.c
@@ -84,6 +87,9 @@ CRC Functions
 .. kernel-doc:: lib/crc-ccitt.c
    :export:
 
+.. kernel-doc:: lib/crc-itu-t.c
+   :export:
+
 idr/ida Functions
 -----------------
 
--- lnx-413.orig/lib/crc32.c
+++ lnx-413/lib/crc32.c
@@ -225,7 +225,7 @@ static u32 __attribute_const__ gf2_multi
 }
 
 /**
- * crc32_generic_shift - Append len 0 bytes to crc, in logarithmic time
+ * crc32_generic_shift - Append @len 0 bytes to crc, in logarithmic time
  * @crc: The original little-endian CRC (i.e. lsbit is x^31 coefficient)
  * @len: The number of bytes. @crc is multiplied by x^(8*@len)
  * @polynomial: The modulus used to reduce the result to 32 bits.
--- lnx-413.orig/lib/crc8.c
+++ lnx-413/lib/crc8.c
@@ -20,11 +20,11 @@
 #include <linux/crc8.h>
 #include <linux/printk.h>
 
-/*
+/**
  * crc8_populate_msb - fill crc table for given polynomial in reverse bit order.
  *
- * table:	table to be filled.
- * polynomial:	polynomial for which table is to be filled.
+ * @table:	table to be filled.
+ * @polynomial:	polynomial for which table is to be filled.
  */
 void crc8_populate_msb(u8 table[CRC8_TABLE_SIZE], u8 polynomial)
 {
@@ -42,11 +42,11 @@ void crc8_populate_msb(u8 table[CRC8_TAB
 }
 EXPORT_SYMBOL(crc8_populate_msb);
 
-/*
+/**
  * crc8_populate_lsb - fill crc table for given polynomial in regular bit order.
  *
- * table:	table to be filled.
- * polynomial:	polynomial for which table is to be filled.
+ * @table:	table to be filled.
+ * @polynomial:	polynomial for which table is to be filled.
  */
 void crc8_populate_lsb(u8 table[CRC8_TABLE_SIZE], u8 polynomial)
 {
@@ -63,13 +63,13 @@ void crc8_populate_lsb(u8 table[CRC8_TAB
 }
 EXPORT_SYMBOL(crc8_populate_lsb);
 
-/*
+/**
  * crc8 - calculate a crc8 over the given input data.
  *
- * table: crc table used for calculation.
- * pdata: pointer to data buffer.
- * nbytes: number of bytes in data buffer.
- * crc:	previous returned crc8 value.
+ * @table: crc table used for calculation.
+ * @pdata: pointer to data buffer.
+ * @nbytes: number of bytes in data buffer.
+ * @crc: previous returned crc8 value.
  */
 u8 crc8(const u8 table[CRC8_TABLE_SIZE], u8 *pdata, size_t nbytes, u8 crc)
 {
--- lnx-413.orig/lib/crc4.c
+++ lnx-413/lib/crc4.c
@@ -15,7 +15,7 @@ static const uint8_t crc4_tab[] = {
 
 /**
  * crc4 - calculate the 4-bit crc of a value.
- * @crc:  starting crc4
+ * @c:    starting crc4
  * @x:    value to checksum
  * @bits: number of bits in @x to checksum
  *

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] docs: clean up and add rest of CRC functions to kernel-api.rst
  2017-09-08 23:35 [PATCH] docs: clean up and add rest of CRC functions to kernel-api.rst Randy Dunlap
@ 2017-09-26 21:02 ` Jonathan Corbet
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Corbet @ 2017-09-26 21:02 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-doc, LKML

On Fri, 8 Sep 2017 16:35:55 -0700
Randy Dunlap <rdunlap@infradead.org> wrote:

> 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

I've applied this one too; sorry for being so slow.

Thanks,

jon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-28 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-08 23:35 [PATCH] docs: clean up and add rest of CRC functions to kernel-api.rst Randy Dunlap
2017-09-26 21:02 ` Jonathan Corbet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.