public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tursulin@ursulin.net>
To: linux-kernel@vger.kernel.org
Cc: tursulin@ursulin.net, tvrtko.ursulin@linux.intel.com,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>,
	Bart Van Assche <bart.vanassche@wdc.com>,
	Hannes Reinecke <hare@suse.com>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	Jens Axboe <axboe@kernel.dk>
Subject: [PATCH 1/6] lib/scatterlist: Use natural long for sgl_alloc(_order) length parameter
Date: Wed, 26 Sep 2018 15:16:20 +0100	[thread overview]
Message-ID: <20180926141625.17727-2-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <20180926141625.17727-1-tvrtko.ursulin@linux.intel.com>

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

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 <tvrtko.ursulin@intel.com>
Cc: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Jens Axboe <axboe@kernel.dk>
---
 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


  reply	other threads:[~2018-09-26 14:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 14:16 [PATCH 0/6] lib/scatterlist: sgl API fixes and cleanups Tvrtko Ursulin
2018-09-26 14:16 ` Tvrtko Ursulin [this message]
2018-10-03 15:26   ` [PATCH 1/6] lib/scatterlist: Use natural long for sgl_alloc(_order) length parameter Bart Van Assche
2018-09-26 14:16 ` [PATCH 2/6] lib/scatterlist: Use consistent types in sgl API Tvrtko Ursulin
2018-10-03 15:28   ` Bart Van Assche
2018-09-26 14:16 ` [PATCH 3/6] lib/scatterlist: Skip requesting zeroed allocations in sgl_alloc_order Tvrtko Ursulin
2018-10-03 15:28   ` Bart Van Assche
2018-09-26 14:16 ` [PATCH 4/6] lib/scatterlist: Do not leak pages when high-order allocation fails Tvrtko Ursulin
2018-10-03 15:31   ` Bart Van Assche
2018-09-26 14:16 ` [PATCH 5/6] lib/scatterlist: Use appropriate type for elem_len in sgl_alloc_order Tvrtko Ursulin
2018-10-03 15:32   ` Bart Van Assche
2018-09-26 14:16 ` [PATCH 6/6] lib/scatterlist: Fix overflow check " Tvrtko Ursulin
2018-10-03 15:34   ` Bart Van Assche
2018-10-03 15:56 ` [PATCH 0/6] lib/scatterlist: sgl API fixes and cleanups Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180926141625.17727-2-tvrtko.ursulin@linux.intel.com \
    --to=tursulin@ursulin.net \
    --cc=axboe@kernel.dk \
    --cc=bart.vanassche@wdc.com \
    --cc=hare@suse.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tvrtko.ursulin@intel.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox