Re: [Outreachy kernel] [PATCH] staging: rtl8723bs: Add spaces around '=', '|', '<<'

From: Julia Lawall
Date: Sat Sep 09 2017 - 14:38:54 EST




On Sun, 10 Sep 2017, Harsha Sharma wrote:

> Hi,Thanks for your feedback.
> I checked patch with checkpatch.pl and thought will add spaces around '+' in
> another patch as there are no. of such warnings.
> Should I add them in this patch only or send another patch for it?

Indeed, I only looked at the commit log, which referred to "most binary
operators". Actually, I'm not sure that = is considered to be a binary
operator. If you want to cut things up, perhaps you could do =, and then
do the actual binary operators.

But since they are going to be touching scattered places in the same file,
the patches should be in a series.

julia



>
> Regards,
> Harsha Sharma
>
>
> On Sat, Sep 9, 2017 at 11:56 PM, Julia Lawall <julia.lawall@xxxxxxx> wrote:
>
>
> On Sat, 9 Sep 2017, Harsha Sharma wrote:
>
> > Use one space around most binary operators
> >
> > Signed-off-by: Harsha Sharma <harshasharmaiitr@xxxxxxxxx>
> > ---
> >Â drivers/staging/rtl8723bs/os_dep/os_intfs.c | 26
> +++++++++++++-------------
> >Â 1 file changed, 13 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> > index 0215899..0129381 100644
> > --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> > +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> > @@ -121,7 +121,7 @@
> >
> >Â static int rtw_enusbss = 0;/* 0:disable, 1:enable */
> >
> > -static int rtw_hwpdn_mode =2;/* 0:disable, 1:enable, 2: by
> EFUSE config */
> > +static int rtw_hwpdn_mode = 2;/* 0:disable, 1:enable, 2: by
> EFUSE config */
> >
> >Â #ifdef CONFIG_HW_PWRP_DETECTION
> >Â static int rtw_hwpwrp_detect = 1;
> > @@ -183,7 +183,7 @@
> >
> >Â module_param(rtw_hw_wps_pbc, int, 0644);
> >
> > -static uint rtw_max_roaming_times =2;
> > +static uint rtw_max_roaming_times = 2;
> >Â module_param(rtw_max_roaming_times, uint, 0644);
> >Â MODULE_PARM_DESC(rtw_max_roaming_times,"The max roaming times
> to try");
> >
> > @@ -222,7 +222,7 @@
> > /* BIT4 - RF,                   Â0:
> non-support, 1: support */
> > /* BIT5 - RF_TXPWR_TRACK, Â0: non-support, 1: support */
> > /* BIT6 - RF_TXPWR_LMT,      Â0: non-support, 1:
> support */
> > -static int rtw_load_phy_file = (BIT2|BIT6);
> > +static int rtw_load_phy_file = (BIT2 | BIT6);
> >Â module_param(rtw_load_phy_file, int, 0644);
> >Â MODULE_PARM_DESC(rtw_load_phy_file,"PHY File Bit Map");
> >Â static int rtw_decrypt_phy_file = 0;
> > @@ -255,8 +255,8 @@ static uint loadparam(struct adapter
> *padapter, _nic_hdl pnetdev)
> >
> >Â Â Â Âregistry_par->vrtl_carrier_sense =
> (u8)rtw_vrtl_carrier_sense ;
> >Â Â Â Âregistry_par->vcs_type = (u8)rtw_vcs_type;
> > -Â Â Âregistry_par->rts_thresh =(u16)rtw_rts_thresh;
> > -Â Â Âregistry_par->frag_thresh =(u16)rtw_frag_thresh;
> > +Â Â Âregistry_par->rts_thresh = (u16)rtw_rts_thresh;
> > +Â Â Âregistry_par->frag_thresh = (u16)rtw_frag_thresh;
> >Â Â Â Âregistry_par->preamble = (u8)rtw_preamble;
> >Â Â Â Âregistry_par->scan_mode = (u8)rtw_scan_mode;
> >Â Â Â Âregistry_par->adhoc_tx_pwr = (u8)rtw_adhoc_tx_pwr;
> > @@ -440,7 +440,7 @@ u16 rtw_recv_select_queue(struct sk_buff
> *skb)
> >Â Â Â Âu32 priority;
> >Â Â Â Âu8 *pdata = skb->data;
> >
> > -Â Â Âmemcpy(&eth_type, pdata+(ETH_ALEN<<1), 2);
> > +Â Â Âmemcpy(&eth_type, pdata+(ETH_ALEN << 1), 2);
>
> The + should have space around it also.
>
> julia
>
> >
> >Â Â Â Âswitch (be16_to_cpu(eth_type)) {
> >Â Â Â Â Â Â Â Âcase ETH_P_IP:
> > @@ -652,8 +652,8 @@ static u8 rtw_init_default_value(struct adapter
> *padapter)
> >Â #ifdef CONFIG_GTK_OL
> >Â Â Â Âpsecuritypriv->binstallKCK_KEK = _FAIL;
> >Â #endif /* CONFIG_GTK_OL */
> > -Â Â Âpsecuritypriv->sw_encrypt =pregistrypriv->software_encrypt;
> > -Â Â Âpsecuritypriv->sw_decrypt =pregistrypriv->software_decrypt;
> > +Â Â Âpsecuritypriv->sw_encrypt = pregistrypriv->software_encrypt;
> > +Â Â Âpsecuritypriv->sw_decrypt = pregistrypriv->software_decrypt;
> >
> >Â Â Â Âpsecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /*
> open system */
> >Â Â Â Âpsecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
> > @@ -748,7 +748,7 @@ u8 rtw_reset_drv_sw(struct adapter *padapter)
> >Â Â Â Âpmlmepriv->LinkDetectInfo.TrafficTransitionCount = 0;
> >Â Â Â Âpmlmepriv->LinkDetectInfo.LowPowerTransitionCount = 0;
> >
> > -Â Â Â_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY |_FW_UNDER_LINKING);
> > +Â Â Â_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY |
> _FW_UNDER_LINKING);
> >
> >Â Â Â Âpwrctrlpriv->pwr_state_check_cnts = 0;
> >
> > @@ -777,7 +777,7 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
> >Â Â Â Â Â Â Â Âgoto exit;
> >Â Â Â Â}
> >
> > -Â Â Âpadapter->cmdpriv.padapter =padapter;
> > +Â Â Âpadapter->cmdpriv.padapter = padapter;
> >
> >Â Â Â Âif ((rtw_init_evt_priv(&padapter->evtpriv)) == _FAIL) {
> >Â Â Â Â Â Â Â ÂRT_TRACE(_module_os_intfs_c_, _drv_err_, ("\n Can't
> init evt_priv\n"));
> > @@ -986,7 +986,7 @@ int _netdev_open(struct net_device *pnetdev)
> >
> >Â Â Â Â Â Â Â ÂDBG_871X("MAC Address = "MAC_FMT"\n",
> MAC_ARG(pnetdev->dev_addr));
> >
> > -Â Â Â Â Â Â Âstatus =rtw_start_drv_threads(padapter);
> > +Â Â Â Â Â Â Âstatus = rtw_start_drv_threads(padapter);
> >Â Â Â Â Â Â Â Âif (status == _FAIL) {
> >Â Â Â Â Â Â Â Â Â Â Â ÂDBG_871X("Initialize driver software resource
> Failed!\n");
> >Â Â Â Â Â Â Â Â Â Â Â Âgoto netdev_open_error;
> > @@ -1641,7 +1641,7 @@ int rtw_resume_process_wow(struct adapter
> *padapter)
> >Â Â Â Â Â Â Â Â}
> >
> >Â Â Â Â Â Â Â Â/* Disable WOW, set H2C command */
> > -Â Â Â Â Â Â Âpoidparam.subcode =WOWLAN_DISABLE;
> > +Â Â Â Â Â Â Âpoidparam.subcode = WOWLAN_DISABLE;
> >Â Â Â Â Â Â Â Âpadapter->HalFunc.SetHwRegHandler(padapter,
> HW_VAR_WOWLAN, (u8 *)&poidparam);
> >
> >Â Â Â Â Â Â Â Âpsta = rtw_get_stainfo(&padapter->stapriv,
> get_bssid(&padapter->mlmepriv));
> > @@ -1705,7 +1705,7 @@ int rtw_resume_process_wow(struct adapter
> *padapter)
> >Â Â Â Â Â Â Â ÂDBG_871X_LEVEL(_drv_always_, "do not reset timer\n");
> >Â Â Â Â}
> >
> > -Â Â Âpwrpriv->wowlan_mode =false;
> > +Â Â Âpwrpriv->wowlan_mode = false;
> >
> >Â Â Â Â/* clean driver side wake up reason. */
> >Â Â Â Âpwrpriv->wowlan_wake_reason = 0;
> > --
> > 1.9.1
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send an email to outreachy-kernel+unsubscribe@xxxxxxxxxxxxxxxxx
> > To post to this group, send email to
> outreachy-kernel@xxxxxxxxxxxxxxxxx
> > To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/1504981213-14584-1-git-s
> end-email-harshasharmaiitr%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
>
>
>
>