diff mbox series

[13/13] bcache: use div_u64() in init_owner_info()

Message ID 20210414054648.24098-14-colyli@suse.de (mailing list archive)
State New, archived
Headers show
Series bcache patches for Linux v5.13 -- 2nd wave | expand

Commit Message

Coly Li April 14, 2021, 5:46 a.m. UTC
Kernel test robot reports the built-in u64/u32 in init_owner_info()
doesn't work for m68k arch, the explicit div_u64() should be used.

This patch explicit uses div_u64() to do the u64/u32 division on
32bit m68k arch.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Coly Li <colyli@suse.de>
Cc: Jianpeng Ma <jianpeng.ma@intel.com>
Cc: Qiaowei Ren <qiaowei.ren@intel.com>
---
 drivers/md/bcache/nvm-pages.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jens Axboe April 16, 2021, 12:01 p.m. UTC | #1
On 4/13/21 11:46 PM, Coly Li wrote:
> Kernel test robot reports the built-in u64/u32 in init_owner_info()
> doesn't work for m68k arch, the explicit div_u64() should be used.
> 
> This patch explicit uses div_u64() to do the u64/u32 division on
> 32bit m68k arch.

This should just be folded into `bcache: initialization of the buddy`
instead of being a separate patch. This is basically identical to what
we talked about for the 1st series, just fold in patches that fix
issues in that very series. No point in having them separate.
diff mbox series

Patch

diff --git a/drivers/md/bcache/nvm-pages.c b/drivers/md/bcache/nvm-pages.c
index c7e3ccc6af46..08cd45e90481 100644
--- a/drivers/md/bcache/nvm-pages.c
+++ b/drivers/md/bcache/nvm-pages.c
@@ -408,7 +408,7 @@  static int init_owner_info(struct bch_nvm_namespace *ns)
 	only_set->owner_list_used = owner_list_head->used;
 
 	/* remove used space */
-	remove_owner_space(ns, 0, ns->pages_offset/ns->page_size);
+	remove_owner_space(ns, 0, div_u64(ns->pages_offset, ns->page_size));
 
 	sys_recs = ns->kaddr + BCH_NVM_PAGES_SYS_RECS_HEAD_OFFSET;
 	/* suppose no hole in array */