diff options
author | Thorsten Blum <thorsten.blum@toblux.com> | 2024-03-06 23:25:47 +0900 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-03-12 13:09:23 -0700 |
commit | adc2c8d0b36f8c97cd3bf7c1420f8d61ee08ce4d (patch) | |
tree | ffe2d65633bec23f031e45e3376dc7f83ca35cf8 /fs/nilfs2/dat.c | |
parent | 8c86fb68ffcb0d8a5418e171c8d359d712912e9b (diff) |
nilfs2: use div64_ul() instead of do_div()
Fixes Coccinelle/coccicheck warnings reported by do_div.cocci.
Compared to do_div(), div64_ul() does not implicitly cast the divisor and
does not unnecessarily calculate the remainder.
Link: https://lkml.kernel.org/r/20240229210456.63234-2-thorsten.blum@toblux.com
Link: https://lkml.kernel.org/r/20240306142547.4612-1-konishi.ryusuke@gmail.com
Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2/dat.c')
-rw-r--r-- | fs/nilfs2/dat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nilfs2/dat.c b/fs/nilfs2/dat.c index 8f71f8b0e218..180fc8d36213 100644 --- a/fs/nilfs2/dat.c +++ b/fs/nilfs2/dat.c @@ -460,7 +460,7 @@ ssize_t nilfs_dat_get_vinfo(struct inode *dat, void *buf, unsigned int visz, kaddr = kmap_local_page(entry_bh->b_page); /* last virtual block number in this block */ first = vinfo->vi_vblocknr; - do_div(first, entries_per_block); + first = div64_ul(first, entries_per_block); first *= entries_per_block; last = first + entries_per_block - 1; for (j = i, n = 0; |