Skip to contentSkip to conversation

lib/scatterlist: fix kerneldoc for sg_pcopy_{to, from}_buffer()

PATCH In review Dave Gordon 3 participants 3 messages Apr 22, 2015 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/scatterlist: fix kerneldoc for sg_pcopy_{to, from}_buffer()

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 <[email protected]>
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.

---
 lib/scatterlist.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/scatterlist.c +2 -2
index c9f2e8c..233ebe7 100644
@@ -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.
  *
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v1 1/1
#1 lore raw

Task id: 6247 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied

PNV                                  276/276              276/276
ILK                                  302/302              302/302
SNB                                  318/318              318/318
IVB                                  341/341              341/341
BYT                                  287/287              287/287
BDW                                  318/318              318/318

-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to Dave Gordon
Quoted 10 lines · 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 <[email protected]>
Date: Mon Jul 8 16:01:54 2013 -0700

Quoted 7 lines

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.

Please run 'scripts/get_maintainer.pl -f lib/scatterlist.c' to get a list of people/lists to send your patch to. Not much we can do on intel-gfx.

BR,
Jani.

Quoted 37 lines
---
 lib/scatterlist.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/scatterlist.c +2 -2
index c9f2e8c..233ebe7 100644
@@ -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.
  *
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx