staging: sm750fb: Remove redundant zero assignments
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
@@ -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
Greg Kroah-Hartman
maintainerQuoted 14 lines · Temitope obabi
The
sm750_devstructure is allocated withdevm_kzalloc()beforesm750fb_setup()is called, so theinit_parmfields are already zero. Remove the four assignments that set them to zero again.Signed-off-by Temitope obabi <[email protected]>--- drivers/staging/sm750fb/sm750.c | 4 ---- 1 file changed, 4 deletions(-)drivers/staging/sm750fb/sm750.c +0
-0
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
Hi Greg,
Thank you for the feedback. I understand that keeping the explicit assignments is preferred, so I will drop this patch.
Thanks,
Temitope