Re: [PATCH] staging: rtlwifi: remove redundant initialization of 'cfg_cmd'

From: Pkshih
Date: Sun Jan 28 2018 - 23:28:05 EST


On Fri, 2018-01-26 at 13:52 +0000, Colin King wrote:
> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>Â
> The initialization of cfg_cmd is redundant as the value is never read
> and it is being re-assigned to cfg_cmd = pwrcfgcmd[ary_idx] inside a
> loop, hence it can be removed.
>Â
> Cleans up clang warning:
> drivers/staging/rtlwifi/core.c:1819:22: warning: Value stored to
> 'cfg_cmd' during its initialization is never read
>Â
> Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>

It looks good to me.

Acked-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>

> ---
>ÂÂdrivers/staging/rtlwifi/core.c | 2 +-
>ÂÂ1 file changed, 1 insertion(+), 1 deletion(-)
>Â
> diff --git a/drivers/staging/rtlwifi/core.c b/drivers/staging/rtlwifi/core.c
> index a43d37452e8b..3ec039498208 100644
> --- a/drivers/staging/rtlwifi/core.c
> +++ b/drivers/staging/rtlwifi/core.c
> @@ -1816,7 +1816,7 @@ bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv,
> u8 cut_version,
>ÂÂ ÂÂÂÂÂÂu8 faversion, u8 interface_type,
>ÂÂ ÂÂÂÂÂÂstruct wlan_pwr_cfg pwrcfgcmd[])
>ÂÂ{
> - struct wlan_pwr_cfg cfg_cmd = {0};
> + struct wlan_pwr_cfg cfg_cmd;
>ÂÂ bool polling_bit = false;
>ÂÂ u32 ary_idx = 0;
>ÂÂ u8 value = 0;
> --Â
> 2.15.1
>Â
>Â
> ------Please consider the environment before printing this e-mail.