Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1222086 > unrolled thread
| Started by | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| First post | 2015-09-10 12:20 +0200 |
| Last post | 2015-09-15 10:10 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH] logfs: fix build warning Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-10 12:20 +0200
Re: [PATCH] logfs: fix build warning Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-15 10:10 +0200
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2015-09-10 12:20 +0200 |
| Subject | [PATCH] logfs: fix build warning |
| Message-ID | <q777s-6Th-17@gated-at.bofh.it> |
While building we were getting build warning of: fs/logfs/dev_bdev.c: In function '__bdev_writeseg': include/linux/kernel.h:601:17: warning: comparison of distinct pointer types lacks a cast [enabled by default] (void) (&_min1 == &_min2); \ fs/logfs/dev_bdev.c:84:14: note: in expansion of macro 'min' max_pages = min(nr_pages, BIO_MAX_PAGES); fs/logfs/dev_bdev.c: In function 'do_erase': include/linux/kernel.h:601:17: warning: comparison of distinct pointer types lacks a cast [enabled by default] (void) (&_min1 == &_min2); \ fs/logfs/dev_bdev.c:174:14: note: in expansion of macro 'min' max_pages = min(nr_pages, BIO_MAX_PAGES); Lets use min_t and mention the type. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> --- fs/logfs/dev_bdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/logfs/dev_bdev.c b/fs/logfs/dev_bdev.c index a7fdbd8..a709d80 100644 --- a/fs/logfs/dev_bdev.c +++ b/fs/logfs/dev_bdev.c @@ -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); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2015-09-15 10:10 +0200 |
| Message-ID | <q8Ttn-7nU-3@gated-at.bofh.it> |
| In reply to | #1222086 |
On Thu, Sep 10, 2015 at 03:41:04PM +0530, Sudip Mukherjee wrote: > While building we were getting build warning of: > > fs/logfs/dev_bdev.c: In function '__bdev_writeseg': > include/linux/kernel.h:601:17: warning: comparison of distinct pointer types lacks a cast [enabled by default] > (void) (&_min1 == &_min2); \ > fs/logfs/dev_bdev.c:84:14: note: in expansion of macro 'min' > max_pages = min(nr_pages, BIO_MAX_PAGES); > > fs/logfs/dev_bdev.c: In function 'do_erase': > include/linux/kernel.h:601:17: warning: comparison of distinct pointer types lacks a cast [enabled by default] > (void) (&_min1 == &_min2); \ > fs/logfs/dev_bdev.c:174:14: note: in expansion of macro 'min' > max_pages = min(nr_pages, BIO_MAX_PAGES); > > Lets use min_t and mention the type. > > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> > --- Hi, I know its too early to ping. But I can still see the build warnings with i386 allmodconfig. Build is at: https://travis-ci.org/sudipm-mukherjee/parport/jobs/80365417 regards sudip -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web