Re: [PATCH 1/6] lib/scatterlist: Use natural long for sgl_alloc(_order) length parameter

2018-10-03 Thread Bart Van Assche
On Wed, 2018-09-26 at 15:16 +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin 
> 
> None of the callers need unsinged long long (they either pass in an int,
   
   unsigned?
> u32, or size_t) so it is not required to burden the 32-bit builds with an
> overspecified length parameter.

Otherwise,

Reviewed-by: Bart Van Assche 



Re: [PATCH 1/6] lib/scatterlist: Use natural long for sgl_alloc(_order) length parameter

2018-10-03 Thread Bart Van Assche
On Wed, 2018-09-26 at 15:16 +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin 
> 
> None of the callers need unsinged long long (they either pass in an int,
   
   unsigned?
> u32, or size_t) so it is not required to burden the 32-bit builds with an
> overspecified length parameter.

Otherwise,

Reviewed-by: Bart Van Assche 



[PATCH 1/6] lib/scatterlist: Use natural long for sgl_alloc(_order) length parameter

2018-09-26 Thread Tvrtko Ursulin
From: Tvrtko Ursulin 

None of the callers need unsinged long long (they either pass in an int,
u32, or size_t) so it is not required to burden the 32-bit builds with an
overspecified length parameter.

Signed-off-by: Tvrtko Ursulin 
Cc: Bart Van Assche 
Cc: Hannes Reinecke 
Cc: Johannes Thumshirn 
Cc: Jens Axboe 
---
 include/linux/scatterlist.h |  8 
 lib/scatterlist.c   | 10 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 093aa57120b0..bdede25901b5 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -280,10 +280,10 @@ int sg_alloc_table_from_pages(struct sg_table *sgt, 
struct page **pages,
  unsigned long size, gfp_t gfp_mask);
 
 #ifdef CONFIG_SGL_ALLOC
-struct scatterlist *sgl_alloc_order(unsigned long long length,
-   unsigned int order, bool chainable,
-   gfp_t gfp, unsigned int *nent_p);
-struct scatterlist *sgl_alloc(unsigned long long length, gfp_t gfp,
+struct scatterlist *sgl_alloc_order(unsigned long length, unsigned int order,
+   bool chainable, gfp_t gfp,
+   unsigned int *nent_p);
+struct scatterlist *sgl_alloc(unsigned long length, gfp_t gfp,
  unsigned int *nent_p);
 void sgl_free_n_order(struct scatterlist *sgl, int nents, int order);
 void sgl_free_order(struct scatterlist *sgl, int order);
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 7c6096a71704..014018f90e28 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -475,9 +475,9 @@ EXPORT_SYMBOL(sg_alloc_table_from_pages);
  *
  * Returns: A pointer to an initialized scatterlist or %NULL upon failure.
  */
-struct scatterlist *sgl_alloc_order(unsigned long long length,
-   unsigned int order, bool chainable,
-   gfp_t gfp, unsigned int *nent_p)
+struct scatterlist *sgl_alloc_order(unsigned long length, unsigned int order,
+   bool chainable, gfp_t gfp,
+   unsigned int *nent_p)
 {
struct scatterlist *sgl, *sg;
struct page *page;
@@ -514,7 +514,7 @@ struct scatterlist *sgl_alloc_order(unsigned long long 
length,
length -= elem_len;
sg = sg_next(sg);
}
-   WARN_ONCE(length, "length = %lld\n", length);
+   WARN_ONCE(length, "length = %ld\n", length);
if (nent_p)
*nent_p = nent;
return sgl;
@@ -529,7 +529,7 @@ EXPORT_SYMBOL(sgl_alloc_order);
  *
  * Returns: A pointer to an initialized scatterlist or %NULL upon failure.
  */
-struct scatterlist *sgl_alloc(unsigned long long length, gfp_t gfp,
+struct scatterlist *sgl_alloc(unsigned long length, gfp_t gfp,
  unsigned int *nent_p)
 {
return sgl_alloc_order(length, 0, false, gfp, nent_p);
-- 
2.17.1



[PATCH 1/6] lib/scatterlist: Use natural long for sgl_alloc(_order) length parameter

2018-09-26 Thread Tvrtko Ursulin
From: Tvrtko Ursulin 

None of the callers need unsinged long long (they either pass in an int,
u32, or size_t) so it is not required to burden the 32-bit builds with an
overspecified length parameter.

Signed-off-by: Tvrtko Ursulin 
Cc: Bart Van Assche 
Cc: Hannes Reinecke 
Cc: Johannes Thumshirn 
Cc: Jens Axboe 
---
 include/linux/scatterlist.h |  8 
 lib/scatterlist.c   | 10 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 093aa57120b0..bdede25901b5 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -280,10 +280,10 @@ int sg_alloc_table_from_pages(struct sg_table *sgt, 
struct page **pages,
  unsigned long size, gfp_t gfp_mask);
 
 #ifdef CONFIG_SGL_ALLOC
-struct scatterlist *sgl_alloc_order(unsigned long long length,
-   unsigned int order, bool chainable,
-   gfp_t gfp, unsigned int *nent_p);
-struct scatterlist *sgl_alloc(unsigned long long length, gfp_t gfp,
+struct scatterlist *sgl_alloc_order(unsigned long length, unsigned int order,
+   bool chainable, gfp_t gfp,
+   unsigned int *nent_p);
+struct scatterlist *sgl_alloc(unsigned long length, gfp_t gfp,
  unsigned int *nent_p);
 void sgl_free_n_order(struct scatterlist *sgl, int nents, int order);
 void sgl_free_order(struct scatterlist *sgl, int order);
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 7c6096a71704..014018f90e28 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -475,9 +475,9 @@ EXPORT_SYMBOL(sg_alloc_table_from_pages);
  *
  * Returns: A pointer to an initialized scatterlist or %NULL upon failure.
  */
-struct scatterlist *sgl_alloc_order(unsigned long long length,
-   unsigned int order, bool chainable,
-   gfp_t gfp, unsigned int *nent_p)
+struct scatterlist *sgl_alloc_order(unsigned long length, unsigned int order,
+   bool chainable, gfp_t gfp,
+   unsigned int *nent_p)
 {
struct scatterlist *sgl, *sg;
struct page *page;
@@ -514,7 +514,7 @@ struct scatterlist *sgl_alloc_order(unsigned long long 
length,
length -= elem_len;
sg = sg_next(sg);
}
-   WARN_ONCE(length, "length = %lld\n", length);
+   WARN_ONCE(length, "length = %ld\n", length);
if (nent_p)
*nent_p = nent;
return sgl;
@@ -529,7 +529,7 @@ EXPORT_SYMBOL(sgl_alloc_order);
  *
  * Returns: A pointer to an initialized scatterlist or %NULL upon failure.
  */
-struct scatterlist *sgl_alloc(unsigned long long length, gfp_t gfp,
+struct scatterlist *sgl_alloc(unsigned long length, gfp_t gfp,
  unsigned int *nent_p)
 {
return sgl_alloc_order(length, 0, false, gfp, nent_p);
-- 
2.17.1