Skip to content

Commit 3cc0f8f

Browse files
ruanjinjie-engalexdeucher
authored andcommitted
drm/radeon: 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 259d968 commit 3cc0f8f

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/gpu/drm/radeon/radeon_agp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static struct radeon_agpmode_quirk radeon_agpmode_quirk_list[] = {
130130
struct radeon_agp_head *radeon_agp_head_init(struct drm_device *dev)
131131
{
132132
struct pci_dev *pdev = to_pci_dev(dev->dev);
133-
struct radeon_agp_head *head = NULL;
133+
struct radeon_agp_head *head;
134134

135135
head = kzalloc(sizeof(*head), GFP_KERNEL);
136136
if (!head)

drivers/gpu/drm/radeon/radeon_combios.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ struct radeon_encoder_primary_dac *radeon_combios_get_primary_dac_info(struct
863863
struct radeon_device *rdev = dev->dev_private;
864864
uint16_t dac_info;
865865
uint8_t rev, bg, dac;
866-
struct radeon_encoder_primary_dac *p_dac = NULL;
866+
struct radeon_encoder_primary_dac *p_dac;
867867
int found = 0;
868868

869869
p_dac = kzalloc(sizeof(struct radeon_encoder_primary_dac),
@@ -1014,7 +1014,7 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct
10141014
struct radeon_device *rdev = dev->dev_private;
10151015
uint16_t dac_info;
10161016
uint8_t rev, bg, dac;
1017-
struct radeon_encoder_tv_dac *tv_dac = NULL;
1017+
struct radeon_encoder_tv_dac *tv_dac;
10181018
int found = 0;
10191019

10201020
tv_dac = kzalloc(sizeof(struct radeon_encoder_tv_dac), GFP_KERNEL);
@@ -1100,7 +1100,7 @@ static struct radeon_encoder_lvds *radeon_legacy_get_lvds_info_from_regs(struct
11001100
radeon_device
11011101
*rdev)
11021102
{
1103-
struct radeon_encoder_lvds *lvds = NULL;
1103+
struct radeon_encoder_lvds *lvds;
11041104
uint32_t fp_vert_stretch, fp_horz_stretch;
11051105
uint32_t ppll_div_sel, ppll_val;
11061106
uint32_t lvds_ss_gen_cntl = RREG32(RADEON_LVDS_SS_GEN_CNTL);

drivers/gpu/drm/radeon/radeon_legacy_encoders.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ static struct radeon_encoder_int_tmds *radeon_legacy_get_tmds_info(struct radeon
16921692
{
16931693
struct drm_device *dev = encoder->base.dev;
16941694
struct radeon_device *rdev = dev->dev_private;
1695-
struct radeon_encoder_int_tmds *tmds = NULL;
1695+
struct radeon_encoder_int_tmds *tmds;
16961696
bool ret;
16971697

16981698
tmds = kzalloc(sizeof(struct radeon_encoder_int_tmds), GFP_KERNEL);
@@ -1715,7 +1715,7 @@ static struct radeon_encoder_ext_tmds *radeon_legacy_get_ext_tmds_info(struct ra
17151715
{
17161716
struct drm_device *dev = encoder->base.dev;
17171717
struct radeon_device *rdev = dev->dev_private;
1718-
struct radeon_encoder_ext_tmds *tmds = NULL;
1718+
struct radeon_encoder_ext_tmds *tmds;
17191719
bool ret;
17201720

17211721
if (rdev->is_atom_bios)

0 commit comments

Comments
 (0)