drm/amd/display: Remove unnecessary NULL values
authorRuan Jinjie <ruanjinjie@huawei.com>
Wed, 9 Aug 2023 03:44:40 +0000 (11:44 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Aug 2023 22:08:27 +0000 (18:08 -0400)
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>
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c

index 4f005ae..6b31904 100644 (file)
@@ -96,7 +96,7 @@ struct dc_bios *bios_parser_create(
        struct bp_init_data *init,
        enum dce_version dce_version)
 {
-       struct bios_parser *bp = NULL;
+       struct bios_parser *bp;
 
        bp = kzalloc(sizeof(struct bios_parser), GFP_KERNEL);
        if (!bp)
@@ -2576,7 +2576,7 @@ static struct integrated_info *bios_parser_create_integrated_info(
        struct dc_bios *dcb)
 {
        struct bios_parser *bp = BP_FROM_DCB(dcb);
-       struct integrated_info *info = NULL;
+       struct integrated_info *info;
 
        info = kzalloc(sizeof(struct integrated_info), GFP_KERNEL);
 
index 033ce26..484d62b 100644 (file)
@@ -3086,7 +3086,7 @@ static struct integrated_info *bios_parser_create_integrated_info(
        struct dc_bios *dcb)
 {
        struct bios_parser *bp = BP_FROM_DCB(dcb);
-       struct integrated_info *info = NULL;
+       struct integrated_info *info;
 
        info = kzalloc(sizeof(struct integrated_info), GFP_KERNEL);
 
@@ -3675,7 +3675,7 @@ struct dc_bios *firmware_parser_create(
        struct bp_init_data *init,
        enum dce_version dce_version)
 {
-       struct bios_parser *bp = NULL;
+       struct bios_parser *bp;
 
        bp = kzalloc(sizeof(struct bios_parser), GFP_KERNEL);
        if (!bp)