[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <04e0e0c1-5d21-4910-8063-c1ef67bc1eac@stanley.mountain>
Date: Sat, 12 Apr 2025 20:36:09 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Erick Karanja <karanja99erick@...il.com>
Cc: gregkh@...uxfoundation.org, outreachy@...ts.linux.dev,
philipp.g.hortmann@...il.com, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/6] staging: rtl8723bs: Initialize variables at
declaration in odm_HWConfig.c
On Thu, Apr 10, 2025 at 04:06:07PM +0300, Erick Karanja wrote:
> Make the code more concise and readable by integrating the initialization
> directly into the variable declaration in cases where the initialization
> is simple and doesn't depend on other variables or complex expressions.
>
> Signed-off-by: Erick Karanja <karanja99erick@...il.com>
> ---
> drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
> index 994b8c578e7a..85cda5c3a5b5 100644
> --- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
> +++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
> @@ -52,9 +52,8 @@ static u8 odm_evm_db_to_percentage(s8 value)
> /* */
> /* -33dB~0dB to 0%~99% */
> /* */
> - s8 ret_val;
> + s8 ret_val = value;
>
> - ret_val = value;
> ret_val /= 2;
Better to write this one as:
s8 ret_val = value / 2;
regards,
dan carpenter
>
> if (ret_val >= 0)
> --
> 2.43.0
>
Powered by blists - more mailing lists