Re: [PATCH 2/7] staging: ks7010: Remove unused variables

From: Nathan Chancellor
Date: Mon May 07 2018 - 13:59:46 EST


On Sun, May 06, 2018 at 03:02:59PM -0700, Nathan Chancellor wrote:
> GCC warns these variables are all set but never used so remove them.
>
> Signed-off-by: Nathan Chancellor <natechancellor@xxxxxxxxx>
> ---
> drivers/staging/ks7010/ks_hostif.c | 12 +-----------
> 1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
> index c0a9a67dc0b4..4c2f8f710c6e 100644
> --- a/drivers/staging/ks7010/ks_hostif.c
> +++ b/drivers/staging/ks7010/ks_hostif.c
> @@ -354,7 +354,6 @@ void hostif_data_indication(struct ks_wlan_private *priv)
> unsigned short auth_type;
> unsigned char temp[256];
> struct ether_hdr *eth_hdr;
> - unsigned short eth_proto;
> struct ieee802_1x_hdr *aa1x_hdr;
> size_t size;
> int ret;
> @@ -369,7 +368,6 @@ void hostif_data_indication(struct ks_wlan_private *priv)
> get_word(priv); /* Reserve Area */
>
> eth_hdr = (struct ether_hdr *)(priv->rxp);
> - eth_proto = ntohs(eth_hdr->h_proto);
>
> /* source address check */
> if (ether_addr_equal(&priv->eth_addr[0], eth_hdr->h_source)) {
> @@ -464,13 +462,9 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
> struct net_device *dev = priv->net_dev;
> u32 mib_status;
> u32 mib_attribute;
> - u16 mib_val_size;
> - u16 mib_val_type;
>
> mib_status = get_dword(priv); /* MIB status */
> mib_attribute = get_dword(priv); /* MIB atttibute */
> - mib_val_size = get_word(priv); /* MIB value size */
> - mib_val_type = get_word(priv); /* MIB value type */
>
> if (mib_status) {
> netdev_err(priv->net_dev, "attribute=%08X, status=%08X\n",
> @@ -792,9 +786,6 @@ void hostif_ps_adhoc_set_confirm(struct ks_wlan_private *priv)
> static
> void hostif_infrastructure_set_confirm(struct ks_wlan_private *priv)
> {
> - u16 result_code;
> -
> - result_code = get_word(priv);
> priv->infra_status = 1; /* infrastructure mode set */
> hostif_sme_enqueue(priv, SME_MODE_SET_CONFIRM);
> }
> @@ -872,14 +863,13 @@ static
> void hostif_phy_information_confirm(struct ks_wlan_private *priv)
> {
> struct iw_statistics *wstats = &priv->wstats;
> - unsigned char rssi, signal, noise;
> + unsigned char rssi, signal;
> unsigned char link_speed;
> unsigned int transmitted_frame_count, received_fragment_count;
> unsigned int failed_count, fcs_error_count;
>
> rssi = get_byte(priv);
> signal = get_byte(priv);
> - noise = get_byte(priv);
> link_speed = get_byte(priv);
> transmitted_frame_count = get_dword(priv);
> received_fragment_count = get_dword(priv);
> --
> 2.17.0
>

On second glance, I did not realize most of these functions involve
pointer semantics. Please do not apply this. I can send a v2 series if
necessary although every other patch is fine.

Thanks,
Nathan