Skip to content

Commit 3873d06

Browse files
hdellerTrond Myklebust
authored andcommitted
nfs: fix do_div() warning by instead using sector_div()
When compiling a 32bit kernel with CONFIG_LBDAF=n the compiler complains like shown below. Fix this warning by instead using sector_div() which is provided by the kernel.h header file. fs/nfs/blocklayout/extents.c: In function ‘normalize’: include/asm-generic/div64.h:43:28: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/blocklayout/extents.c:47:13: note: in expansion of macro ‘do_div’ nfs/blocklayout/extents.c:47:2: warning: right shift count >= width of type [enabled by default] fs/nfs/blocklayout/extents.c:47:2: warning: passing argument 1 of ‘__div64_32’ from incompatible pointer type [enabled by default] include/asm-generic/div64.h:35:17: note: expected ‘uint64_t *’ but argument is of type ‘sector_t *’ extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor); Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
1 parent cd7b996 commit 3873d06

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/nfs/blocklayout/extents.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
static inline sector_t normalize(sector_t s, int base)
4545
{
4646
sector_t tmp = s; /* Since do_div modifies its argument */
47-
return s - do_div(tmp, base);
47+
return s - sector_div(tmp, base);
4848
}
4949

5050
static inline sector_t normalize_up(sector_t s, int base)

0 commit comments

Comments
 (0)