summaryrefslogtreecommitdiff
path: root/block/bio.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-03-23 13:24:55 +0300
committerJens Axboe <axboe@fb.com>2017-03-23 08:16:11 -0600
commit7a88fa191944589b2ed795bbed32ca6e9e2df31f (patch)
tree08ffd2bfc3cdf1f9ff08c0eeafc468dce213315c /block/bio.c
parenta4d907b6a33ba22adbbfc443e22eb3c1aa2c73f6 (diff)
block: make nr_iovecs unsigned in bio_alloc_bioset()
There isn't a bug here, but Smatch is not smart enough to know that "nr_iovecs" can't be negative so it complains about underflows. Really, it's slightly cleaner to make this parameter unsigned. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/bio.c')
-rw-r--r--block/bio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/bio.c b/block/bio.c
index e75878f8b14a..6194a8cf2aab 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -427,7 +427,8 @@ static void punt_bios_to_rescuer(struct bio_set *bs)
* RETURNS:
* Pointer to new bio on success, NULL on failure.
*/
-struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs)
+struct bio *bio_alloc_bioset(gfp_t gfp_mask, unsigned int nr_iovecs,
+ struct bio_set *bs)
{
gfp_t saved_gfp = gfp_mask;
unsigned front_pad;