Skip to content

Commit

Permalink
f2fs: remove unneeded initialization
Browse files Browse the repository at this point in the history
No need to initialize  "struct f2fs_gc_kthread *gc_th = NULL",
as gc_th = NULL, will be taken care by the return values of kmalloc().
And fix codes in other places.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
  • Loading branch information
Namjae Jeon authored and Jaegeuk Kim committed Dec 11, 2012
1 parent 1fa95b0 commit 1042d60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fs/f2fs/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static int gc_thread_func(void *data)

int start_gc_thread(struct f2fs_sb_info *sbi)
{
struct f2fs_gc_kthread *gc_th = NULL;
struct f2fs_gc_kthread *gc_th;

gc_th = kmalloc(sizeof(struct f2fs_gc_kthread), GFP_KERNEL);
if (!gc_th)
Expand Down
4 changes: 2 additions & 2 deletions fs/f2fs/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ static int build_free_segmap(struct f2fs_sb_info *sbi)

static int build_curseg(struct f2fs_sb_info *sbi)
{
struct curseg_info *array = NULL;
struct curseg_info *array;
int i;

array = kzalloc(sizeof(*array) * NR_CURSEG_TYPE, GFP_KERNEL);
Expand Down Expand Up @@ -1656,7 +1656,7 @@ int build_segment_manager(struct f2fs_sb_info *sbi)
{
struct f2fs_super_block *raw_super = F2FS_RAW_SUPER(sbi);
struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
struct f2fs_sm_info *sm_info = NULL;
struct f2fs_sm_info *sm_info;
int err;

sm_info = kzalloc(sizeof(struct f2fs_sm_info), GFP_KERNEL);
Expand Down

0 comments on commit 1042d60

Please sign in to comment.