* [PATCH v2 0/2] staging: sm750fb: Remove unused return values from functions
@ 2023-10-19 10:13 Dorcas AnonoLitunya
2023-10-19 10:13 ` [PATCH v2 1/2] staging: sm750fb: Remove unused return value in display_control_adjust_sm750le() Dorcas AnonoLitunya
2023-10-19 10:13 ` [PATCH v2 2/2] staging: sm750fb: Remove unused return variable in program_mode_registers() Dorcas AnonoLitunya
0 siblings, 2 replies; 5+ messages in thread
From: Dorcas AnonoLitunya @ 2023-10-19 10:13 UTC (permalink / raw)
Cc: anonolitunya, outreachy, julia.lawall, dan.carpenter,
Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman, linux-fbdev,
linux-staging, linux-kernel
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
<gregkh@linuxfoundation.org>, Dan Carpenter <dan.carpenter@linaro.org>
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
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH v2 1/2] staging: sm750fb: Remove unused return value in display_control_adjust_sm750le()
2023-10-19 10:13 [PATCH v2 0/2] staging: sm750fb: Remove unused return values from functions Dorcas AnonoLitunya
@ 2023-10-19 10:13 ` Dorcas AnonoLitunya
2023-10-21 10:01 ` Greg Kroah-Hartman
2023-10-19 10:13 ` [PATCH v2 2/2] staging: sm750fb: Remove unused return variable in program_mode_registers() Dorcas AnonoLitunya
1 sibling, 1 reply; 5+ messages in thread
From: Dorcas AnonoLitunya @ 2023-10-19 10:13 UTC (permalink / raw)
Cc: anonolitunya, outreachy, julia.lawall, dan.carpenter,
Greg Kroah-Hartman, Sudip Mukherjee, Teddy Wang, linux-fbdev,
linux-staging, linux-kernel
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 <anonolitunya@gmail.com>
---
drivers/staging/sm750fb/ddk750_mode.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c
index bcdd291d25c9..83ace6cc9583 100644
--- a/drivers/staging/sm750fb/ddk750_mode.c
+++ b/drivers/staging/sm750fb/ddk750_mode.c
@@ -13,7 +13,7 @@
* HW only supports 7 predefined pixel clocks, and clock select is
* in bit 29:27 of Display Control register.
*/
-static unsigned long
+static void
display_control_adjust_sm750le(struct mode_parameter *mode_param,
unsigned long disp_control)
{
@@ -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);
-
- return disp_control;
}
/* only timing related registers will be programed */
--
2.42.0.345.gaab89be2eb
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v2 1/2] staging: sm750fb: Remove unused return value in display_control_adjust_sm750le()
2023-10-19 10:13 ` [PATCH v2 1/2] staging: sm750fb: Remove unused return value in display_control_adjust_sm750le() Dorcas AnonoLitunya
@ 2023-10-21 10:01 ` Greg Kroah-Hartman
2023-11-01 15:36 ` Dorcas Anono Litunya
0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2023-10-21 10:01 UTC (permalink / raw)
To: Dorcas AnonoLitunya
Cc: outreachy, julia.lawall, dan.carpenter, Sudip Mukherjee,
Teddy Wang, linux-fbdev, linux-staging, linux-kernel
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 <anonolitunya@gmail.com>
> ---
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/2] staging: sm750fb: Remove unused return value in display_control_adjust_sm750le()
2023-10-21 10:01 ` Greg Kroah-Hartman
@ 2023-11-01 15:36 ` Dorcas Anono Litunya
0 siblings, 0 replies; 5+ messages in thread
From: Dorcas Anono Litunya @ 2023-11-01 15:36 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: outreachy, julia.lawall, dan.carpenter, Sudip Mukherjee,
Teddy Wang, linux-fbdev, linux-staging, linux-kernel
On 21/10/2023 13:01, Greg Kroah-Hartman wrote:
> 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 <anonolitunya@gmail.com>
>> ---
>> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] staging: sm750fb: Remove unused return variable in program_mode_registers()
2023-10-19 10:13 [PATCH v2 0/2] staging: sm750fb: Remove unused return values from functions Dorcas AnonoLitunya
2023-10-19 10:13 ` [PATCH v2 1/2] staging: sm750fb: Remove unused return value in display_control_adjust_sm750le() Dorcas AnonoLitunya
@ 2023-10-19 10:13 ` Dorcas AnonoLitunya
1 sibling, 0 replies; 5+ messages in thread
From: Dorcas AnonoLitunya @ 2023-10-19 10:13 UTC (permalink / raw)
Cc: anonolitunya, outreachy, julia.lawall, dan.carpenter,
Greg Kroah-Hartman, Sudip Mukherjee, Teddy Wang, linux-fbdev,
linux-staging, linux-kernel
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 <anonolitunya@gmail.com>
---
Changes in v2:
- Drop variable 'ret' entirely as it is unused.
Suggested-by: Julia Lawall <julia.lawall@inria.fr>, Greg Kroah-Hartman
<gregkh@linuxfoundation.org>, Dan Carpenter <dan.carpenter@linaro.org>
drivers/staging/sm750fb/ddk750_mode.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c
index 83ace6cc9583..4278f9a826ab 100644
--- a/drivers/staging/sm750fb/ddk750_mode.c
+++ b/drivers/staging/sm750fb/ddk750_mode.c
@@ -73,10 +73,9 @@ display_control_adjust_sm750le(struct mode_parameter *mode_param,
}
/* only timing related registers will be programed */
-static int program_mode_registers(struct mode_parameter *mode_param,
- struct pll_value *pll)
+static void program_mode_registers(struct mode_parameter *mode_param,
+ struct pll_value *pll)
{
- int ret = 0;
int cnt = 0;
unsigned int tmp, 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;
}
- return ret;
}
int ddk750_set_mode_timing(struct mode_parameter *parm, enum clock_type clock)
--
2.42.0.345.gaab89be2eb
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-11-01 15:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-19 10:13 [PATCH v2 0/2] staging: sm750fb: Remove unused return values from functions Dorcas AnonoLitunya
2023-10-19 10:13 ` [PATCH v2 1/2] staging: sm750fb: Remove unused return value in display_control_adjust_sm750le() Dorcas AnonoLitunya
2023-10-21 10:01 ` Greg Kroah-Hartman
2023-11-01 15:36 ` Dorcas Anono Litunya
2023-10-19 10:13 ` [PATCH v2 2/2] staging: sm750fb: Remove unused return variable in program_mode_registers() Dorcas AnonoLitunya
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).