Return-path: Received: from esa2.microchip.iphmx.com ([68.232.149.84]:15273 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727406AbeHWLlf (ORCPT ); Thu, 23 Aug 2018 07:41:35 -0400 Subject: Re: [PATCH 24/24] staging: wilc1000: remove unnecessary static variable 'p2p_listen_state' To: Ajay Singh , CC: , , , , , References: <1534229416-13254-1-git-send-email-ajay.kathat@microchip.com> <1534229416-13254-25-git-send-email-ajay.kathat@microchip.com> From: Claudiu Beznea Message-ID: (sfid-20180823_101321_036818_8DD34837) Date: Thu, 23 Aug 2018 11:13:04 +0300 MIME-Version: 1.0 In-Reply-To: <1534229416-13254-25-git-send-email-ajay.kathat@microchip.com> Content-Type: text/plain; charset="utf-8" Sender: linux-wireless-owner@vger.kernel.org List-ID: On 14.08.2018 09:50, Ajay Singh wrote: > Remove the use of unnecessary static variable 'p2p_listen_state'. > Already 'p2p_listen_state' is present in 'wilc_priv' struct. So making > use of that variable as its getting set in channel ready and > remain on channel expired callback. > > Signed-off-by: Ajay Singh > --- > drivers/staging/wilc1000/host_interface.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c > index d8cc08b..cf7ead5 100644 > --- a/drivers/staging/wilc1000/host_interface.c > +++ b/drivers/staging/wilc1000/host_interface.c > @@ -185,8 +185,6 @@ struct join_bss_param { > u8 start_time[4]; > }; > > -static u8 p2p_listen_state; > - > /* 'msg' should be free by the caller for syc */ > static struct host_if_msg* > wilc_alloc_work(struct wilc_vif *vif, void (*work_fun)(struct work_struct *), > @@ -2351,7 +2349,6 @@ static int handle_remain_on_chan(struct wilc_vif *vif, > netdev_err(vif->ndev, "Failed to set remain on channel\n"); > > error: > - p2p_listen_state = 1; > hif_drv->remain_on_ch_timer_vif = vif; > mod_timer(&hif_drv->remain_on_ch_timer, > jiffies + msecs_to_jiffies(hif_remain_ch->duration)); > @@ -2407,8 +2404,9 @@ static void handle_listen_state_expired(struct work_struct *work) > struct wid wid; > int result; > struct host_if_drv *hif_drv = vif->hif_drv; > + struct wilc_priv *priv = wdev_priv(vif->ndev->ieee80211_ptr); > > - if (p2p_listen_state) { > + if (priv->p2p_listen_state) { > remain_on_chan_flag = false; > wid.id = WID_REMAIN_ON_CHAN; > wid.type = WID_STR; > @@ -2433,7 +2431,6 @@ static void handle_listen_state_expired(struct work_struct *work) > hif_drv->remain_on_ch.expired(hif_drv->remain_on_ch.arg, > hif_remain_ch->id); > } > - p2p_listen_state = 0; Is this useless at all? > } else { > netdev_dbg(vif->ndev, "Not in listen state\n"); > } >