bcache: correct return value in register_nvdimm_meta()
Subsystems (2)
PATCH 1/4 bcache: correct return value in register_nvdimm_meta()
'ret' should be used a return value, thi patch fixes this error.
--- drivers/md/bcache/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/super.c +1 -1
@@ -2554,7 +2554,7 @@ static ssize_t register_nvdimm_meta(struct kobject *k, struct kobj_attribute *at ret = -EINVAL; } -return size; +return ret; }#endif
Signature · 1 line
2.26.2
PATCH 2/4 bcache: use div_u64() in init_owner_info()
Kernel test robot reports the build-in u64/u32 in init_owner_info() doesn't work for m68k arch, the explict div_u64() should be used.
This patch explicit uses div_u64() to do the u64/u32 division on 32bit m68k arch.
--- drivers/md/bcache/nvm-pages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/nvm-pages.c +1 -1
@@ -521,7 +521,7 @@ static int init_owner_info(struct bch_nvm_namespace *ns) only_set->owner_list_size = owner_list_head->size; only_set->owner_list_used = owner_list_head->used; -remove_owner_space (ns,0 , ns->pages_offset/ns->page_size); +remove_owner_space (ns,0 ,div_u64 (ns->pages_offset, ns->page_size));for (i =0 ; i < owner_list_head->used; i++) { owner_head = &owner_list_head->heads[i];
Signature · 1 line
2.26.2
Re: [PATCH 2/4] bcache: use div_u64() in init_owner_info()
Quoted 10 lines · Coly Li
Kernel test robot reports the build-in u64/u32 in
init_owner_info()doesn't work for m68k arch, the explictdiv_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 <[email protected]>Signed-off-by Coly Li <[email protected]>Cc Jianpeng Ma <[email protected]>Cc Qiaowei Ren <[email protected]>
Looks good.
PATCH 3/4 bcache: unify code comments style in nvm-pages.c
In reply to Coly LiMake nvm-pages.c follow code comments style of other bcache code.
--- drivers/md/bcache/nvm-pages.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/md/bcache/nvm-pages.c +3 -3
@@ -270,7 +270,7 @@ static void write_owner_info(void) owner_list_head->size =BCH_MAX_OWNER_LIST ;WARN_ON (only_set->owner_list_used > owner_list_head->size); -// in-memory owner maybe not contain alloced-pages. +/* in-memory owner maybe not contain alloced-pages. */ for (i =0 ; i < only_set->owner_list_used; i++) { owner_head = &owner_list_head->heads[i]; owner_list = only_set->owner_lists[i];
@@ -569,14 +569,14 @@ static int init_owner_info(struct bch_nvm_namespace *ns) extent->nr = rec->nr;WARN_ON (!is_power_of_2 (extent->nr)); -/*init struct page: index/private */ +/* init struct page: index/private */ order =ilog2 (extent->nr); page =nvm_vaddr_to_page (ns, extent->kaddr);set_page_private (page, order); page->index = rec->pgoff;list_add_tail (&extent->list, &extents->extent_head); -/*remove already alloced space*/ +/* remove already alloced space */ remove_owner_space (extents->ns, rec->pgoff, rec->nr); } extents->nr += nvm_pgalloc_recs->used;
Signature · 1 line
2.26.2
Re: [PATCH 3/4] bcache: unify code comments style in nvm-pages.c
Quoted 3 lines · Coly Li
Make
nvm-pages.cfollow code comments style of other bcache code.Signed-off-by Coly Li <[email protected]>
Looks good.
PATCH 4/4 bcache: fix a typo in nvme-pages.c
In reply to Coly LiThis patch fixes a typo in init_owner_info() which causes an invalid pointer checking from a kazlloc().
--- drivers/md/bcache/nvm-pages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/nvm-pages.c +1 -1
@@ -561,7 +561,7 @@ static int init_owner_info(struct bch_nvm_namespace *ns)for (k =0 ; k < nvm_pgalloc_recs->used; k++) { rec = &nvm_pgalloc_recs->recs[k]; extent =kzalloc (sizeof (*extent),GFP_KERNEL ); -if (!extents) { +if (!extent) {mutex_unlock (&only_set->lock);return -ENOMEM ; }
Signature · 1 line
2.26.2
Re: [PATCH 4/4] bcache: fix a typo in nvme-pages.c
Quoted 8 lines · Coly Li
This patch fixes a typo in
init_owner_info()which causes an invalid pointer checking from akazlloc().Reported-by Dan Carpenter <[email protected]>Signed-off-by Coly Li <[email protected]>Cc Jianpeng Ma <[email protected]>Cc Qiaowei Ren <[email protected]>
Looks good.
Quoted 1 line · Coly Li
'ret' should be used a return value, thi patch fixes this error.
How about following commit log ?
The local variable should be used to return right error code from the register_nvdimm_meta() instead of size variable.
Quoted 3 lines
Reported-by kernel test robot <[email protected]>Signed-off-by Coly Li <[email protected]>---
Looks good.