Skip to contentSkip to conversation

staging: sm750fb: Remove redundant zero assignments

PATCH In review Temitope obabi 2 participants 3 messages Oct 18 – Oct 19

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: sm750fb: Remove redundant zero assignments

The sm750_dev structure is allocated with devm_kzalloc() before sm750fb_setup() is called, so the init_parm fields are already zero. Remove the four assignments that set them to zero again.

---
 drivers/staging/sm750fb/sm750.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/staging/sm750fb/sm750.c +0 -4
index 8b93bfeb217b..21744a5a63fb 100644
@@ -833,10 +833,6 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
 
 	swap = 0;
 
-	sm750_dev->init_parm.chip_clock = 0;
-	sm750_dev->init_parm.mem_clock = 0;
-	sm750_dev->init_parm.master_clock = 0;
-	sm750_dev->init_parm.power_mode = 0;
 	sm750_dev->init_parm.reset_memory = 1;
 
 	/* defaultly turn g_hwcursor on for both view */
Signature · 1 line
2.53.0
#1 lore raw
Quoted 14 lines · Temitope obabi

The sm750_dev structure is allocated with devm_kzalloc() before sm750fb_setup() is called, so the init_parm fields are already zero. Remove the four assignments that set them to zero again.

---
 drivers/staging/sm750fb/sm750.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/staging/sm750fb/sm750.c +0 -0
index 8b93bfeb217b..21744a5a63fb 100644

drivers/staging/sm750fb/sm750.c static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src) · line 839

Quoted 7 lines
drivers/staging/sm750fb/sm750.c +0 -4
@@ -833,10 +833,6 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
 
 	swap = 0;
 
-	sm750_dev->init_parm.chip_clock = 0;
-	sm750_dev->init_parm.mem_clock = 0;
-	sm750_dev->init_parm.master_clock = 0;
-	sm750_dev->init_parm.power_mode = 0;

This is good to keep as it is explict what is happening, right?

thanks,

greg k-h

#2 lore raw

Hi Greg,

Thank you for the feedback. I understand that keeping the explicit assignments is preferred, so I will drop this patch.

Thanks,
Temitope