Skip to content

Commit 0858582

Browse files
Erick Archerweiny2
authored andcommitted
nvdimm/btt: use sizeof(*pointer) instead of sizeof(type)
It is preferred to use sizeof(*pointer) instead of sizeof(type) due to the type of the variable can change and one needs not change the former (unlike the latter). This patch has no effect on runtime behavior. Signed-off-by: Erick Archer <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Link: https://patch.msgid.link/r/AS8PR02MB72372490C53FB2E35DA1ADD08BFE2@AS8PR02MB7237.eurprd02.prod.outlook.com Signed-off-by: Ira Weiny <[email protected]>
1 parent c3f38fa commit 0858582

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/nvdimm/btt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ static struct arena_info *alloc_arena(struct btt *btt, size_t size,
751751
u64 logsize, mapsize, datasize;
752752
u64 available = size;
753753

754-
arena = kzalloc(sizeof(struct arena_info), GFP_KERNEL);
754+
arena = kzalloc(sizeof(*arena), GFP_KERNEL);
755755
if (!arena)
756756
return NULL;
757757
arena->nd_btt = btt->nd_btt;
@@ -978,7 +978,7 @@ static int btt_arena_write_layout(struct arena_info *arena)
978978
if (ret)
979979
return ret;
980980

981-
super = kzalloc(sizeof(struct btt_sb), GFP_NOIO);
981+
super = kzalloc(sizeof(*super), GFP_NOIO);
982982
if (!super)
983983
return -ENOMEM;
984984

0 commit comments

Comments
 (0)