Modifies the return type of different static functions to void and
deletes unused return variables as the return value is being ignored
in all subsequent function calls thus not useful to have a return type.
This improves code readability and maintainability.
Changes in v2:
- Ammend wording in cover letter.
Suggested-by: Julia Lawall <julia.lawall@inria.fr>
- Drop variable 'ret' entirely as it is unused.
Suggested-by: Julia Lawall <julia.lawall@inria.fr>, Greg Kroah-Hartman
[off-list ref], Dan Carpenter [off-list ref]
Dorcas AnonoLitunya (2):
staging: sm750fb: Remove unused return value in
display_control_adjust_sm750le()
staging: sm750fb: Remove unused return variable in
program_mode_registers()
drivers/staging/sm750fb/ddk750_mode.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
--
2.42.0.345.gaab89be2eb
Modifies the return type of display_control_adjust_sm750le()
to void from unsigned long as the return value is being ignored in
all subsequent function calls.
This improves code readability and maintainability.
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Dorcas AnonoLitunya <redacted>
---
drivers/staging/sm750fb/ddk750_mode.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
@@ -70,8 +70,6 @@ display_control_adjust_sm750le(struct mode_parameter *mode_param,disp_control|=DISPLAY_CTRL_CLOCK_PHASE;poke32(CRT_DISPLAY_CTRL,disp_control);--returndisp_control;}/* only timing related registers will be programed */
Drops variable ret as it is unused in the code. This therefore modifies
the return type of program_mode_registers() to void from int since the
return value is being ignored in all function calls. This improves code
readability and maintainability.
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Dorcas AnonoLitunya <redacted>
---
Changes in v2:
- Drop variable 'ret' entirely as it is unused.
Suggested-by: Julia Lawall <julia.lawall@inria.fr>, Greg Kroah-Hartman
[off-list ref], Dan Carpenter [off-list ref]
drivers/staging/sm750fb/ddk750_mode.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
@@ -73,10 +73,9 @@ display_control_adjust_sm750le(struct mode_parameter *mode_param,}/* only timing related registers will be programed */-staticintprogram_mode_registers(structmode_parameter*mode_param,-structpll_value*pll)+staticvoidprogram_mode_registers(structmode_parameter*mode_param,+structpll_value*pll){-intret=0;intcnt=0;unsignedinttmp,reg;
@@ -199,10 +198,7 @@ static int program_mode_registers(struct mode_parameter *mode_param,break;poke32(PANEL_DISPLAY_CTRL,tmp|reg);}-}else{-ret=-1;}-returnret;}intddk750_set_mode_timing(structmode_parameter*parm,enumclock_typeclock)
On Thu, Oct 19, 2023 at 01:13:36PM +0300, Dorcas AnonoLitunya wrote:
Modifies the return type of display_control_adjust_sm750le()
to void from unsigned long as the return value is being ignored in
all subsequent function calls.
This improves code readability and maintainability.
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Dorcas AnonoLitunya <redacted>
---
drivers/staging/sm750fb/ddk750_mode.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
This patch doesn't apply against my latest branch. Please rebase it and
resend.
thanks,
greg k-h
On Thu, Oct 19, 2023 at 01:13:36PM +0300, Dorcas AnonoLitunya wrote:
quoted
Modifies the return type of display_control_adjust_sm750le()
to void from unsigned long as the return value is being ignored in
all subsequent function calls.
This improves code readability and maintainability.
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Dorcas AnonoLitunya <redacted>
---
drivers/staging/sm750fb/ddk750_mode.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
This patch doesn't apply against my latest branch. Please rebase it and
resend.
thanks,
greg k-h
Hi Greg,
Sorry for the delay. Was occupied on the project starter tasks. I have
rebased the patch and resent it. Thanks!
Dorcas