diff options
author | Dave Gordon <david.s.gordon@intel.com> | 2015-06-30 17:58:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-30 22:44:59 -0400 |
commit | 386ecb1216f9e38947ce6a2af22e5e1e47256a97 (patch) | |
tree | eeaa8bce553855a9ab106ef4a9166f1695835472 /lib | |
parent | 2a1bf8f93b33992bb0457512b28d046e279bbd7e (diff) |
drivers/scsi/scsi_debug.c: resolve sg buffer const-ness issue
do_device_access() takes a separate parameter to indicate the direction of
data transfer, which it used to use to select the appropriate function out
of sg_pcopy_{to,from}_buffer(). However these two functions now have
So this patch makes it bypass these wrappers and call the underlying
function sg_copy_buffer() directly; this has the same calling style as
do_device_access() i.e. a separate direction-of-transfer parameter and no
pointers-to-const, so skipping the wrappers not only eliminates the
warning, it also make the code simpler :)
[akpm@linux-foundation.org: fix very broken build]
Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/scatterlist.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/scatterlist.c b/lib/scatterlist.c index 317b62c6da3c..d105a9f56878 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c | |||
@@ -650,9 +650,8 @@ EXPORT_SYMBOL(sg_miter_stop); | |||
650 | * Returns the number of copied bytes. | 650 | * Returns the number of copied bytes. |
651 | * | 651 | * |
652 | **/ | 652 | **/ |
653 | static size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, | 653 | size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf, |
654 | void *buf, size_t buflen, off_t skip, | 654 | size_t buflen, off_t skip, bool to_buffer) |
655 | bool to_buffer) | ||
656 | { | 655 | { |
657 | unsigned int offset = 0; | 656 | unsigned int offset = 0; |
658 | struct sg_mapping_iter miter; | 657 | struct sg_mapping_iter miter; |
@@ -689,6 +688,7 @@ static size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, | |||
689 | local_irq_restore(flags); | 688 | local_irq_restore(flags); |
690 | return offset; | 689 | return offset; |
691 | } | 690 | } |
691 | EXPORT_SYMBOL(sg_copy_buffer); | ||
692 | 692 | ||
693 | /** | 693 | /** |
694 | * sg_copy_from_buffer - Copy from a linear buffer to an SG list | 694 | * sg_copy_from_buffer - Copy from a linear buffer to an SG list |