All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib/scatterlist: fix kerneldoc for sg_pcopy_{to, from}_buffer()
@ 2015-04-22 11:30 Dave Gordon
  2015-04-22 15:01 ` shuang.he
  2015-04-22 22:13 ` Jani Nikula
  0 siblings, 2 replies; 5+ messages in thread
From: Dave Gordon @ 2015-04-22 11:30 UTC (permalink / raw)
  To: intel-gfx; +Cc: Akinobu Mita

The kerneldoc for the functions doesn't match the code; the
last two parameters (buflen, skip) have been transposed, which
is confusing, especially as they're both integral types and the
compiler won't warn about swapping them.

These functions and the kerneldoc were introduced in commit:
    df642cea lib/scatterlist: introduce sg_pcopy_from_buffer() ...
    Author: Akinobu Mita <akinobu.mita@gmail.com>
    Date:   Mon Jul 8 16:01:54 2013 -0700

    The only difference between sg_pcopy_{from,to}_buffer() and
    sg_copy_{from,to}_buffer() is an additional argument that
    specifies the number of bytes to skip the SG list before
    copying.

The functions have the extra argument at the end, but the kerneldoc
lists it in penultimate position.

Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
---
 lib/scatterlist.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index c9f2e8c..233ebe7 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -697,8 +697,8 @@ EXPORT_SYMBOL(sg_copy_to_buffer);
  * @sgl:		 The SG list
  * @nents:		 Number of SG entries
  * @buf:		 Where to copy from
- * @skip:		 Number of bytes to skip before copying
  * @buflen:		 The number of bytes to copy
+ * @skip:		 Number of bytes to skip before copying
  *
  * Returns the number of copied bytes.
  *
@@ -715,8 +715,8 @@ EXPORT_SYMBOL(sg_pcopy_from_buffer);
  * @sgl:		 The SG list
  * @nents:		 Number of SG entries
  * @buf:		 Where to copy to
- * @skip:		 Number of bytes to skip before copying
  * @buflen:		 The number of bytes to copy
+ * @skip:		 Number of bytes to skip before copying
  *
  * Returns the number of copied bytes.
  *
-- 
1.7.9.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] lib/scatterlist: fix kerneldoc for sg_pcopy_{to,from}_buffer()
@ 2015-04-23 13:57 Dave Gordon
  2015-04-23 14:13 ` Akinobu Mita
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Gordon @ 2015-04-23 13:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: Akinobu Mita, Martin K. Petersen, Dave Gordon

The kerneldoc for the functions doesn't match the code; the
last two parameters (buflen, skip) have been transposed, which
is confusing, especially as they're both integral types and the
compiler won't warn about swapping them.

These functions and the kerneldoc were introduced in commit:
    df642cea lib/scatterlist: introduce sg_pcopy_from_buffer() ...
    Author: Akinobu Mita <akinobu.mita@gmail.com>
    Date:   Mon Jul 8 16:01:54 2013 -0700

    The only difference between sg_pcopy_{from,to}_buffer() and
    sg_copy_{from,to}_buffer() is an additional argument that
    specifies the number of bytes to skip the SG list before
    copying.

The functions have the extra argument at the end, but the kerneldoc
lists it in penultimate position.

Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
---
 lib/scatterlist.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index c9f2e8c..233ebe7 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -697,8 +697,8 @@ EXPORT_SYMBOL(sg_copy_to_buffer);
  * @sgl:		 The SG list
  * @nents:		 Number of SG entries
  * @buf:		 Where to copy from
- * @skip:		 Number of bytes to skip before copying
  * @buflen:		 The number of bytes to copy
+ * @skip:		 Number of bytes to skip before copying
  *
  * Returns the number of copied bytes.
  *
@@ -715,8 +715,8 @@ EXPORT_SYMBOL(sg_pcopy_from_buffer);
  * @sgl:		 The SG list
  * @nents:		 Number of SG entries
  * @buf:		 Where to copy to
- * @skip:		 Number of bytes to skip before copying
  * @buflen:		 The number of bytes to copy
+ * @skip:		 Number of bytes to skip before copying
  *
  * Returns the number of copied bytes.
  *
-- 
1.7.9.5


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

end of thread, other threads:[~2015-04-23 14:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-22 11:30 [PATCH] lib/scatterlist: fix kerneldoc for sg_pcopy_{to, from}_buffer() Dave Gordon
2015-04-22 15:01 ` shuang.he
2015-04-22 22:13 ` Jani Nikula
  -- strict thread matches above, loose matches on Subject: below --
2015-04-23 13:57 [PATCH] lib/scatterlist: fix kerneldoc for sg_pcopy_{to,from}_buffer() Dave Gordon
2015-04-23 14:13 ` Akinobu Mita

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.