* [PATCH] staging: rtlwifi: remove redundant initialization of 'cfg_cmd'
@ 2018-01-26 13:52 Colin King
2018-01-29 4:27 ` Pkshih
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-01-26 13:52 UTC (permalink / raw)
To: Greg Kroah-Hartman, Ping-Ke Shih, devel; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
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@canonical.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: rtlwifi: remove redundant initialization of 'cfg_cmd'
2018-01-26 13:52 [PATCH] staging: rtlwifi: remove redundant initialization of 'cfg_cmd' Colin King
@ 2018-01-29 4:27 ` Pkshih
0 siblings, 0 replies; 2+ messages in thread
From: Pkshih @ 2018-01-29 4:27 UTC (permalink / raw)
To: colin.king@canonical.com, gregkh@linuxfoundation.org,
devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
On Fri, 2018-01-26 at 13:52 +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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@canonical.com>
It looks good to me.
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
> ---
> 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-29 4:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-26 13:52 [PATCH] staging: rtlwifi: remove redundant initialization of 'cfg_cmd' Colin King
2018-01-29 4:27 ` Pkshih
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox