Skip to content

Commit 259d968

Browse files
ruanjinjie-engalexdeucher
authored andcommitted
drm/amd/display: Remove unnecessary NULL values
The NULL initialization of the pointers assigned by kzalloc() first is not necessary, because if the kzalloc() failed, the pointers will be assigned NULL, otherwise it works as usual. so remove it. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent a31c114 commit 259d968

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/gpu/drm/amd/display/dc/bios/bios_parser.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ struct dc_bios *bios_parser_create(
9696
struct bp_init_data *init,
9797
enum dce_version dce_version)
9898
{
99-
struct bios_parser *bp = NULL;
99+
struct bios_parser *bp;
100100

101101
bp = kzalloc(sizeof(struct bios_parser), GFP_KERNEL);
102102
if (!bp)
@@ -2576,7 +2576,7 @@ static struct integrated_info *bios_parser_create_integrated_info(
25762576
struct dc_bios *dcb)
25772577
{
25782578
struct bios_parser *bp = BP_FROM_DCB(dcb);
2579-
struct integrated_info *info = NULL;
2579+
struct integrated_info *info;
25802580

25812581
info = kzalloc(sizeof(struct integrated_info), GFP_KERNEL);
25822582

drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3086,7 +3086,7 @@ static struct integrated_info *bios_parser_create_integrated_info(
30863086
struct dc_bios *dcb)
30873087
{
30883088
struct bios_parser *bp = BP_FROM_DCB(dcb);
3089-
struct integrated_info *info = NULL;
3089+
struct integrated_info *info;
30903090

30913091
info = kzalloc(sizeof(struct integrated_info), GFP_KERNEL);
30923092

@@ -3675,7 +3675,7 @@ struct dc_bios *firmware_parser_create(
36753675
struct bp_init_data *init,
36763676
enum dce_version dce_version)
36773677
{
3678-
struct bios_parser *bp = NULL;
3678+
struct bios_parser *bp;
36793679

36803680
bp = kzalloc(sizeof(struct bios_parser), GFP_KERNEL);
36813681
if (!bp)

0 commit comments

Comments
 (0)