logfs: Use min_t() to compare different types
PATCH 1/1 logfs: Use min_t() to compare different types
fs/logfs/dev_bdev.c: In function ‘__bdev_writeseg’:fs/logfs/dev_bdev.c:84: warning: comparison of distinct pointer types lacks a cast fs/logfs/dev_bdev.c: In function ‘do_erase’:fs/logfs/dev_bdev.c:174: warning: comparison of distinct pointer types lacks a cast
Until b54ffb73cadcdcff ("block: remove bio_get_nr_vecs()") there were explicit casts to "size_t" to avoid compiler warnings. Use "min_t(size_t, ...)" instead.
Fixes b54ffb73cadcdcff ("block: remove bio_get_nr_vecs()").
Signed-off-by Geert Uytterhoeven <[email protected]>
---
The nearby code desperately needs some int/unsigned int/size_t cleanups (e.g. an "int" loop counter with a "size_t" limit?).
--- fs/logfs/dev_bdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/logfs/dev_bdev.c +2 -2
@@ -81,7 +81,7 @@ static int __bdev_writeseg(struct super_block *sb, u64 ofs, pgoff_t index,unsigned int max_pages;int i; - max_pages =min (nr_pages,BIO_MAX_PAGES ); + max_pages =min_t (size_t, nr_pages,BIO_MAX_PAGES ); bio =bio_alloc (GFP_NOFS , max_pages);BUG_ON (!bio);
@@ -171,7 +171,7 @@ static int do_erase(struct super_block *sb, u64 ofs, pgoff_t index,unsigned int max_pages;int i; - max_pages =min (nr_pages,BIO_MAX_PAGES ); + max_pages =min_t (size_t, nr_pages,BIO_MAX_PAGES ); bio =bio_alloc (GFP_NOFS , max_pages);BUG_ON (!bio);
Signature · 1 line
1.9.1