diff mbox

[OPW,kernel,01/11] staging: vt6656: removed unnecessary braces around if-else statements

Message ID 1384208208-12564-1-git-send-email-nandu.hgowda@gmail.com
State New, archived
Headers show

Commit Message

nandini h Nov. 11, 2013, 10:16 p.m. UTC
removed unnecessary braces around if-else statement whenever
the if-else construct was followed by just single line of code
to comply with linux coding style

Signed-off-by: Nandini Hanumanthagowda <nandu.hgowda@gmail.com>
---
 drivers/staging/vt6656/wcmd.c |   53 ++++++++++++++++-------------------------
 1 file changed, 20 insertions(+), 33 deletions(-)

Comments

Andrew Grover Nov. 11, 2013, 10:21 p.m. UTC | #1
On Mon, Nov 11, 2013 at 2:16 PM, Nandini Hanumanthagowda <
nandu.hgowda@gmail.com> wrote:

> removed unnecessary braces around if-else statement whenever
> the if-else construct was followed by just single line of code
> to comply with linux coding style
>
> Signed-off-by: Nandini Hanumanthagowda <nandu.hgowda@gmail.com>
> ---
>  drivers/staging/vt6656/wcmd.c |   53
> ++++++++++++++++-------------------------
>  1 file changed, 20 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
> index ca57fc3..22d0038 100644
> --- a/drivers/staging/vt6656/wcmd.c
> +++ b/drivers/staging/vt6656/wcmd.c
> @@ -108,9 +108,7 @@ static void vAdHocBeaconStop(struct vnt_private
> *pDevice)
>              bStop = true;
>          }
>          if (pMgmt->uIBSSChannel >  CB_MAX_CHANNEL_24G)
> -        {
>              bStop = true;
> -        }
>      }
>
>      if (bStop)
> @@ -182,13 +180,13 @@ static void s_vProbeChannel(struct vnt_private
> *pDevice)
>         u8 *pbyRate;
>         int ii;
>
> -    if (pDevice->byBBType == BB_TYPE_11A) {
> -        pbyRate = &abyCurrSuppRatesA[0];
> -    } else if (pDevice->byBBType == BB_TYPE_11B) {
> -        pbyRate = &abyCurrSuppRatesB[0];
> -    } else {
> -        pbyRate = &abyCurrSuppRatesG[0];
> -    }
> +       if (pDevice->byBBType == BB_TYPE_11A)
> +               pbyRate = &abyCurrSuppRatesA[0];
> +       else if (pDevice->byBBType == BB_TYPE_11B)
> +               pbyRate = &abyCurrSuppRatesB[0];
> +       else
> +               pbyRate = &abyCurrSuppRatesG[0];
> +
>      // build an assocreq frame and send it
>      pTxPacket = s_MgrMakeProbeRequest
>                  (
> @@ -204,10 +202,9 @@ static void s_vProbeChannel(struct vnt_private
> *pDevice)
>          for (ii = 0; ii < 1; ii++) {
>              if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING) {
>                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request sending
> fail.. \n");
> -            }
> -            else {
> +           } else {
>                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request is
> sending.. \n");
> -            }
> +           }
>          }
>      }
>
> @@ -316,9 +313,8 @@ void vRunCommand(struct work_struct *work)
>
>              pItemSSID = (PWLAN_IE_SSID)pMgmt->abyScanSSID;
>
> -            if (pMgmt->uScanChannel == 0) {
> +            if (pMgmt->uScanChannel == 0)
>                  pMgmt->uScanChannel = pDevice->byMinChannel;
> -            }
>              if (pMgmt->uScanChannel > pDevice->byMaxChannel) {
>                 pDevice->eCommandState = WLAN_CMD_SCAN_END;
>                  s_bCommandComplete(pDevice);
> @@ -546,9 +542,8 @@ void vRunCommand(struct work_struct *work)
>              // if Adhoc mode
>              else if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
>                  if (pMgmt->eCurrState == WMAC_STATE_JOINTED) {
> -                    if (netif_queue_stopped(pDevice->dev)) {
> +                    if (netif_queue_stopped(pDevice->dev))
>                          netif_wake_queue(pDevice->dev);
> -                    }
>                      pDevice->bLinkPass = true;
>                      ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG,
> MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
>                      pMgmt->sNodeDBTable[0].bActive = true;
> @@ -654,9 +649,8 @@ void vRunCommand(struct work_struct *work)
>                  ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG,
> MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
>                  s_bClearBSSID_SCAN(pDevice);
>
> -                if (netif_queue_stopped(pDevice->dev)) {
> +                if (netif_queue_stopped(pDevice->dev))
>                      netif_wake_queue(pDevice->dev);
> -                }
>
>              }
>            else if (pMgmt->eCurrState < WMAC_STATE_ASSOCPENDING) {
> @@ -700,9 +694,8 @@ void vRunCommand(struct work_struct *work)
>                  pDevice->byRxMode &= ~RCR_UNICAST;
>                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wcmd: rx_mode =
> %x\n", pDevice->byRxMode);
>                  BSSvAddMulticastNode(pDevice);
> -                if (netif_queue_stopped(pDevice->dev)) {
> +                if (netif_queue_stopped(pDevice->dev))
>                      netif_wake_queue(pDevice->dev);
> -                }
>                  pDevice->bLinkPass = true;
>                  ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG,
> MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
>                 schedule_delayed_work(&pDevice->second_callback_work, HZ);
> @@ -722,9 +715,8 @@ void vRunCommand(struct work_struct *work)
>                          pDevice->bMoreData = true;
>                      }
>
> -                    if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0) {
> +                    if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0)
>                          DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Multicast ps
> tx fail \n");
> -                    }
>
>                      pMgmt->sNodeDBTable[0].wEnQueueCnt--;
>                  }
> @@ -747,9 +739,8 @@ void vRunCommand(struct work_struct *work)
>                              pDevice->bMoreData = true;
>                          }
>
> -                        if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) !=
> 0) {
> +                        if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) !=
> 0)
>                              DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "sta ps tx
> fail \n");
> -                        }
>
>                          pMgmt->sNodeDBTable[ii].wEnQueueCnt--;
>                          // check if sta ps enable, wait next pspoll
> @@ -973,11 +964,10 @@ static int s_bCommandComplete(struct vnt_private
> *pDevice)
>                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCommandState=
> WLAN_CMD_BSSID_SCAN\n");
>                  pDevice->eCommandState = WLAN_CMD_SCAN_START;
>                  pMgmt->uScanChannel = 0;
> -                if (pSSID->len != 0) {
> +                if (pSSID->len != 0)
>                      memcpy(pMgmt->abyScanSSID, pSSID, WLAN_IEHDR_LEN +
> WLAN_SSID_MAXLEN + 1);
> -                } else {
> +                else
>                      memset(pMgmt->abyScanSSID, 0, WLAN_IEHDR_LEN +
> WLAN_SSID_MAXLEN + 1);
> -                }
>  /*
>                  if ((bForceSCAN == false) && (pDevice->bLinkPass ==
> true)) {
>                      if ((pSSID->len ==
> ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->len) &&
> @@ -1054,9 +1044,8 @@ int bScheduleCommand(struct vnt_private *pDevice,
>                 CMD_CODE eCommand, u8 *pbyItem0)
>  {
>
> -    if (pDevice->cbFreeCmdQueue == 0) {
> +    if (pDevice->cbFreeCmdQueue == 0)
>          return (false);
> -    }
>      pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].eCmd = eCommand;
>      pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = true;
>      memset(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID,
> 0 , WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
> @@ -1094,11 +1083,9 @@ int bScheduleCommand(struct vnt_private *pDevice,
>      ADD_ONE_WITH_WRAP_AROUND(pDevice->uCmdEnqueueIdx, CMD_Q_SIZE);
>      pDevice->cbFreeCmdQueue--;
>
> -    if (pDevice->bCmdRunning == false) {
> +    if (pDevice->bCmdRunning == false)
>          s_bCommandComplete(pDevice);
> -    }
> -    else {
> -    }
> +
>      return (true);
>
>  }
> --
> 1.7.9.5
>
>
Looks good to me, thanks Nandini.

Reviewed-by: Andy Grover <agrover@redhat.com>
Andrew Grover Nov. 11, 2013, 10:25 p.m. UTC | #2
Oh this is a resend? Please try to do "PATCHv2" next time. :-)

-- Andy


On Mon, Nov 11, 2013 at 2:21 PM, Andrew Grover <andy.grover@gmail.com>wrote:

> On Mon, Nov 11, 2013 at 2:16 PM, Nandini Hanumanthagowda <
> nandu.hgowda@gmail.com> wrote:
>
>> removed unnecessary braces around if-else statement whenever
>> the if-else construct was followed by just single line of code
>> to comply with linux coding style
>>
>> Signed-off-by: Nandini Hanumanthagowda <nandu.hgowda@gmail.com>
>> ---
>>  drivers/staging/vt6656/wcmd.c |   53
>> ++++++++++++++++-------------------------
>>  1 file changed, 20 insertions(+), 33 deletions(-)
>>
>> diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
>> index ca57fc3..22d0038 100644
>> --- a/drivers/staging/vt6656/wcmd.c
>> +++ b/drivers/staging/vt6656/wcmd.c
>> @@ -108,9 +108,7 @@ static void vAdHocBeaconStop(struct vnt_private
>> *pDevice)
>>              bStop = true;
>>          }
>>          if (pMgmt->uIBSSChannel >  CB_MAX_CHANNEL_24G)
>> -        {
>>              bStop = true;
>> -        }
>>      }
>>
>>      if (bStop)
>> @@ -182,13 +180,13 @@ static void s_vProbeChannel(struct vnt_private
>> *pDevice)
>>         u8 *pbyRate;
>>         int ii;
>>
>> -    if (pDevice->byBBType == BB_TYPE_11A) {
>> -        pbyRate = &abyCurrSuppRatesA[0];
>> -    } else if (pDevice->byBBType == BB_TYPE_11B) {
>> -        pbyRate = &abyCurrSuppRatesB[0];
>> -    } else {
>> -        pbyRate = &abyCurrSuppRatesG[0];
>> -    }
>> +       if (pDevice->byBBType == BB_TYPE_11A)
>> +               pbyRate = &abyCurrSuppRatesA[0];
>> +       else if (pDevice->byBBType == BB_TYPE_11B)
>> +               pbyRate = &abyCurrSuppRatesB[0];
>> +       else
>> +               pbyRate = &abyCurrSuppRatesG[0];
>> +
>>      // build an assocreq frame and send it
>>      pTxPacket = s_MgrMakeProbeRequest
>>                  (
>> @@ -204,10 +202,9 @@ static void s_vProbeChannel(struct vnt_private
>> *pDevice)
>>          for (ii = 0; ii < 1; ii++) {
>>              if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING) {
>>                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request
>> sending fail.. \n");
>> -            }
>> -            else {
>> +           } else {
>>                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request is
>> sending.. \n");
>> -            }
>> +           }
>>          }
>>      }
>>
>> @@ -316,9 +313,8 @@ void vRunCommand(struct work_struct *work)
>>
>>              pItemSSID = (PWLAN_IE_SSID)pMgmt->abyScanSSID;
>>
>> -            if (pMgmt->uScanChannel == 0) {
>> +            if (pMgmt->uScanChannel == 0)
>>                  pMgmt->uScanChannel = pDevice->byMinChannel;
>> -            }
>>              if (pMgmt->uScanChannel > pDevice->byMaxChannel) {
>>                 pDevice->eCommandState = WLAN_CMD_SCAN_END;
>>                  s_bCommandComplete(pDevice);
>> @@ -546,9 +542,8 @@ void vRunCommand(struct work_struct *work)
>>              // if Adhoc mode
>>              else if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
>>                  if (pMgmt->eCurrState == WMAC_STATE_JOINTED) {
>> -                    if (netif_queue_stopped(pDevice->dev)) {
>> +                    if (netif_queue_stopped(pDevice->dev))
>>                          netif_wake_queue(pDevice->dev);
>> -                    }
>>                      pDevice->bLinkPass = true;
>>                      ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG,
>> MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
>>                      pMgmt->sNodeDBTable[0].bActive = true;
>> @@ -654,9 +649,8 @@ void vRunCommand(struct work_struct *work)
>>                  ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG,
>> MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
>>                  s_bClearBSSID_SCAN(pDevice);
>>
>> -                if (netif_queue_stopped(pDevice->dev)) {
>> +                if (netif_queue_stopped(pDevice->dev))
>>                      netif_wake_queue(pDevice->dev);
>> -                }
>>
>>              }
>>            else if (pMgmt->eCurrState < WMAC_STATE_ASSOCPENDING) {
>> @@ -700,9 +694,8 @@ void vRunCommand(struct work_struct *work)
>>                  pDevice->byRxMode &= ~RCR_UNICAST;
>>                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wcmd: rx_mode =
>> %x\n", pDevice->byRxMode);
>>                  BSSvAddMulticastNode(pDevice);
>> -                if (netif_queue_stopped(pDevice->dev)) {
>> +                if (netif_queue_stopped(pDevice->dev))
>>                      netif_wake_queue(pDevice->dev);
>> -                }
>>                  pDevice->bLinkPass = true;
>>                  ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG,
>> MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
>>                 schedule_delayed_work(&pDevice->second_callback_work, HZ);
>> @@ -722,9 +715,8 @@ void vRunCommand(struct work_struct *work)
>>                          pDevice->bMoreData = true;
>>                      }
>>
>> -                    if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0)
>> {
>> +                    if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0)
>>                          DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Multicast ps
>> tx fail \n");
>> -                    }
>>
>>                      pMgmt->sNodeDBTable[0].wEnQueueCnt--;
>>                  }
>> @@ -747,9 +739,8 @@ void vRunCommand(struct work_struct *work)
>>                              pDevice->bMoreData = true;
>>                          }
>>
>> -                        if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb)
>> != 0) {
>> +                        if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb)
>> != 0)
>>                              DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "sta ps
>> tx fail \n");
>> -                        }
>>
>>                          pMgmt->sNodeDBTable[ii].wEnQueueCnt--;
>>                          // check if sta ps enable, wait next pspoll
>> @@ -973,11 +964,10 @@ static int s_bCommandComplete(struct vnt_private
>> *pDevice)
>>                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCommandState=
>> WLAN_CMD_BSSID_SCAN\n");
>>                  pDevice->eCommandState = WLAN_CMD_SCAN_START;
>>                  pMgmt->uScanChannel = 0;
>> -                if (pSSID->len != 0) {
>> +                if (pSSID->len != 0)
>>                      memcpy(pMgmt->abyScanSSID, pSSID, WLAN_IEHDR_LEN +
>> WLAN_SSID_MAXLEN + 1);
>> -                } else {
>> +                else
>>                      memset(pMgmt->abyScanSSID, 0, WLAN_IEHDR_LEN +
>> WLAN_SSID_MAXLEN + 1);
>> -                }
>>  /*
>>                  if ((bForceSCAN == false) && (pDevice->bLinkPass ==
>> true)) {
>>                      if ((pSSID->len ==
>> ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->len) &&
>> @@ -1054,9 +1044,8 @@ int bScheduleCommand(struct vnt_private *pDevice,
>>                 CMD_CODE eCommand, u8 *pbyItem0)
>>  {
>>
>> -    if (pDevice->cbFreeCmdQueue == 0) {
>> +    if (pDevice->cbFreeCmdQueue == 0)
>>          return (false);
>> -    }
>>      pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].eCmd = eCommand;
>>      pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = true;
>>      memset(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID,
>> 0 , WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
>> @@ -1094,11 +1083,9 @@ int bScheduleCommand(struct vnt_private *pDevice,
>>      ADD_ONE_WITH_WRAP_AROUND(pDevice->uCmdEnqueueIdx, CMD_Q_SIZE);
>>      pDevice->cbFreeCmdQueue--;
>>
>> -    if (pDevice->bCmdRunning == false) {
>> +    if (pDevice->bCmdRunning == false)
>>          s_bCommandComplete(pDevice);
>> -    }
>> -    else {
>> -    }
>> +
>>      return (true);
>>
>>  }
>> --
>> 1.7.9.5
>>
>>
> Looks good to me, thanks Nandini.
>
> Reviewed-by: Andy Grover <agrover@redhat.com>
>
>
Greg Kroah-Hartman Nov. 12, 2013, 9:47 a.m. UTC | #3
On Tue, Nov 12, 2013 at 03:46:38AM +0530, Nandini Hanumanthagowda wrote:
> removed unnecessary braces around if-else statement whenever
> the if-else construct was followed by just single line of code
> to comply with linux coding style
> 
> Signed-off-by: Nandini Hanumanthagowda <nandu.hgowda@gmail.com>

You add new whitespace issues in this patch, in the lines you changed,
which even git complains about, so I can't apply this, sorry.

Please be more careful with your patches.

thanks,

greg k-h
Sarah Sharp Nov. 12, 2013, 5:45 p.m. UTC | #4
Hi Nandini,

The application period is over.  Please stop sending patches to the
opw-kernel mailing list, and send them to the staging driver mailing
list instead.  Did you not see my "Pencils down" email?

Sarah Sharp

On Tue, Nov 12, 2013 at 03:46:38AM +0530, Nandini Hanumanthagowda wrote:
> removed unnecessary braces around if-else statement whenever
> the if-else construct was followed by just single line of code
> to comply with linux coding style
> 
> Signed-off-by: Nandini Hanumanthagowda <nandu.hgowda@gmail.com>
> ---
>  drivers/staging/vt6656/wcmd.c |   53 ++++++++++++++++-------------------------
>  1 file changed, 20 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
> index ca57fc3..22d0038 100644
> --- a/drivers/staging/vt6656/wcmd.c
> +++ b/drivers/staging/vt6656/wcmd.c
> @@ -108,9 +108,7 @@ static void vAdHocBeaconStop(struct vnt_private *pDevice)
>              bStop = true;
>          }
>          if (pMgmt->uIBSSChannel >  CB_MAX_CHANNEL_24G)
> -        {
>              bStop = true;
> -        }
>      }
>  
>      if (bStop)
> @@ -182,13 +180,13 @@ static void s_vProbeChannel(struct vnt_private *pDevice)
>  	u8 *pbyRate;
>  	int ii;
>  
> -    if (pDevice->byBBType == BB_TYPE_11A) {
> -        pbyRate = &abyCurrSuppRatesA[0];
> -    } else if (pDevice->byBBType == BB_TYPE_11B) {
> -        pbyRate = &abyCurrSuppRatesB[0];
> -    } else {
> -        pbyRate = &abyCurrSuppRatesG[0];
> -    }
> +	if (pDevice->byBBType == BB_TYPE_11A)
> +		pbyRate = &abyCurrSuppRatesA[0];
> +	else if (pDevice->byBBType == BB_TYPE_11B)
> +		pbyRate = &abyCurrSuppRatesB[0];
> +	else
> +		pbyRate = &abyCurrSuppRatesG[0];
> +    
>      // build an assocreq frame and send it
>      pTxPacket = s_MgrMakeProbeRequest
>                  (
> @@ -204,10 +202,9 @@ static void s_vProbeChannel(struct vnt_private *pDevice)
>          for (ii = 0; ii < 1; ii++) {
>              if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING) {
>                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request sending fail.. \n");
> -            }
> -            else {
> +	    } else {
>                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request is sending.. \n");
> -            }
> +	    }	
>          }
>      }
>  
> @@ -316,9 +313,8 @@ void vRunCommand(struct work_struct *work)
>  
>              pItemSSID = (PWLAN_IE_SSID)pMgmt->abyScanSSID;
>  
> -            if (pMgmt->uScanChannel == 0) {
> +            if (pMgmt->uScanChannel == 0)
>                  pMgmt->uScanChannel = pDevice->byMinChannel;
> -            }
>              if (pMgmt->uScanChannel > pDevice->byMaxChannel) {
>  		pDevice->eCommandState = WLAN_CMD_SCAN_END;
>                  s_bCommandComplete(pDevice);
> @@ -546,9 +542,8 @@ void vRunCommand(struct work_struct *work)
>              // if Adhoc mode
>              else if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
>                  if (pMgmt->eCurrState == WMAC_STATE_JOINTED) {
> -                    if (netif_queue_stopped(pDevice->dev)) {
> +                    if (netif_queue_stopped(pDevice->dev))
>                          netif_wake_queue(pDevice->dev);
> -                    }
>                      pDevice->bLinkPass = true;
>                      ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
>                      pMgmt->sNodeDBTable[0].bActive = true;
> @@ -654,9 +649,8 @@ void vRunCommand(struct work_struct *work)
>                  ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
>                  s_bClearBSSID_SCAN(pDevice);
>  
> -                if (netif_queue_stopped(pDevice->dev)) {
> +                if (netif_queue_stopped(pDevice->dev))
>                      netif_wake_queue(pDevice->dev);
> -                }
>  
>              }
>  	   else if (pMgmt->eCurrState < WMAC_STATE_ASSOCPENDING) {
> @@ -700,9 +694,8 @@ void vRunCommand(struct work_struct *work)
>                  pDevice->byRxMode &= ~RCR_UNICAST;
>                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wcmd: rx_mode = %x\n", pDevice->byRxMode);
>                  BSSvAddMulticastNode(pDevice);
> -                if (netif_queue_stopped(pDevice->dev)) {
> +                if (netif_queue_stopped(pDevice->dev))
>                      netif_wake_queue(pDevice->dev);
> -                }
>                  pDevice->bLinkPass = true;
>                  ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
>  		schedule_delayed_work(&pDevice->second_callback_work, HZ);
> @@ -722,9 +715,8 @@ void vRunCommand(struct work_struct *work)
>                          pDevice->bMoreData = true;
>                      }
>  
> -                    if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0) {
> +                    if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0)
>                          DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Multicast ps tx fail \n");
> -                    }
>  
>                      pMgmt->sNodeDBTable[0].wEnQueueCnt--;
>                  }
> @@ -747,9 +739,8 @@ void vRunCommand(struct work_struct *work)
>                              pDevice->bMoreData = true;
>                          }
>  
> -                        if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0) {
> +                        if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0)
>                              DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "sta ps tx fail \n");
> -                        }
>  
>                          pMgmt->sNodeDBTable[ii].wEnQueueCnt--;
>                          // check if sta ps enable, wait next pspoll
> @@ -973,11 +964,10 @@ static int s_bCommandComplete(struct vnt_private *pDevice)
>                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCommandState= WLAN_CMD_BSSID_SCAN\n");
>                  pDevice->eCommandState = WLAN_CMD_SCAN_START;
>                  pMgmt->uScanChannel = 0;
> -                if (pSSID->len != 0) {
> +                if (pSSID->len != 0)
>                      memcpy(pMgmt->abyScanSSID, pSSID, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
> -                } else {
> +                else
>                      memset(pMgmt->abyScanSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
> -                }
>  /*
>                  if ((bForceSCAN == false) && (pDevice->bLinkPass == true)) {
>                      if ((pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->len) &&
> @@ -1054,9 +1044,8 @@ int bScheduleCommand(struct vnt_private *pDevice,
>  		CMD_CODE eCommand, u8 *pbyItem0)
>  {
>  
> -    if (pDevice->cbFreeCmdQueue == 0) {
> +    if (pDevice->cbFreeCmdQueue == 0)
>          return (false);
> -    }
>      pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].eCmd = eCommand;
>      pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = true;
>      memset(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID, 0 , WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
> @@ -1094,11 +1083,9 @@ int bScheduleCommand(struct vnt_private *pDevice,
>      ADD_ONE_WITH_WRAP_AROUND(pDevice->uCmdEnqueueIdx, CMD_Q_SIZE);
>      pDevice->cbFreeCmdQueue--;
>  
> -    if (pDevice->bCmdRunning == false) {
> +    if (pDevice->bCmdRunning == false)
>          s_bCommandComplete(pDevice);
> -    }
> -    else {
> -    }
> +
>      return (true);
>  
>  }
> -- 
> 1.7.9.5
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
Sarah Sharp Nov. 12, 2013, 5:49 p.m. UTC | #5
On Tue, Nov 12, 2013 at 09:45:48AM -0800, Sarah Sharp wrote:
> Hi Nandini,
> 
> The application period is over.  Please stop sending patches to the
> opw-kernel mailing list, and send them to the staging driver mailing
> list instead.  Did you not see my "Pencils down" email?

Ah, never mind, I see your later email.  Disregard this.

Sarah Sharp

> On Tue, Nov 12, 2013 at 03:46:38AM +0530, Nandini Hanumanthagowda wrote:
> > removed unnecessary braces around if-else statement whenever
> > the if-else construct was followed by just single line of code
> > to comply with linux coding style
> > 
> > Signed-off-by: Nandini Hanumanthagowda <nandu.hgowda@gmail.com>
> > ---
> >  drivers/staging/vt6656/wcmd.c |   53 ++++++++++++++++-------------------------
> >  1 file changed, 20 insertions(+), 33 deletions(-)
> > 
> > diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
> > index ca57fc3..22d0038 100644
> > --- a/drivers/staging/vt6656/wcmd.c
> > +++ b/drivers/staging/vt6656/wcmd.c
> > @@ -108,9 +108,7 @@ static void vAdHocBeaconStop(struct vnt_private *pDevice)
> >              bStop = true;
> >          }
> >          if (pMgmt->uIBSSChannel >  CB_MAX_CHANNEL_24G)
> > -        {
> >              bStop = true;
> > -        }
> >      }
> >  
> >      if (bStop)
> > @@ -182,13 +180,13 @@ static void s_vProbeChannel(struct vnt_private *pDevice)
> >  	u8 *pbyRate;
> >  	int ii;
> >  
> > -    if (pDevice->byBBType == BB_TYPE_11A) {
> > -        pbyRate = &abyCurrSuppRatesA[0];
> > -    } else if (pDevice->byBBType == BB_TYPE_11B) {
> > -        pbyRate = &abyCurrSuppRatesB[0];
> > -    } else {
> > -        pbyRate = &abyCurrSuppRatesG[0];
> > -    }
> > +	if (pDevice->byBBType == BB_TYPE_11A)
> > +		pbyRate = &abyCurrSuppRatesA[0];
> > +	else if (pDevice->byBBType == BB_TYPE_11B)
> > +		pbyRate = &abyCurrSuppRatesB[0];
> > +	else
> > +		pbyRate = &abyCurrSuppRatesG[0];
> > +    
> >      // build an assocreq frame and send it
> >      pTxPacket = s_MgrMakeProbeRequest
> >                  (
> > @@ -204,10 +202,9 @@ static void s_vProbeChannel(struct vnt_private *pDevice)
> >          for (ii = 0; ii < 1; ii++) {
> >              if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING) {
> >                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request sending fail.. \n");
> > -            }
> > -            else {
> > +	    } else {
> >                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request is sending.. \n");
> > -            }
> > +	    }	
> >          }
> >      }
> >  
> > @@ -316,9 +313,8 @@ void vRunCommand(struct work_struct *work)
> >  
> >              pItemSSID = (PWLAN_IE_SSID)pMgmt->abyScanSSID;
> >  
> > -            if (pMgmt->uScanChannel == 0) {
> > +            if (pMgmt->uScanChannel == 0)
> >                  pMgmt->uScanChannel = pDevice->byMinChannel;
> > -            }
> >              if (pMgmt->uScanChannel > pDevice->byMaxChannel) {
> >  		pDevice->eCommandState = WLAN_CMD_SCAN_END;
> >                  s_bCommandComplete(pDevice);
> > @@ -546,9 +542,8 @@ void vRunCommand(struct work_struct *work)
> >              // if Adhoc mode
> >              else if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
> >                  if (pMgmt->eCurrState == WMAC_STATE_JOINTED) {
> > -                    if (netif_queue_stopped(pDevice->dev)) {
> > +                    if (netif_queue_stopped(pDevice->dev))
> >                          netif_wake_queue(pDevice->dev);
> > -                    }
> >                      pDevice->bLinkPass = true;
> >                      ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
> >                      pMgmt->sNodeDBTable[0].bActive = true;
> > @@ -654,9 +649,8 @@ void vRunCommand(struct work_struct *work)
> >                  ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
> >                  s_bClearBSSID_SCAN(pDevice);
> >  
> > -                if (netif_queue_stopped(pDevice->dev)) {
> > +                if (netif_queue_stopped(pDevice->dev))
> >                      netif_wake_queue(pDevice->dev);
> > -                }
> >  
> >              }
> >  	   else if (pMgmt->eCurrState < WMAC_STATE_ASSOCPENDING) {
> > @@ -700,9 +694,8 @@ void vRunCommand(struct work_struct *work)
> >                  pDevice->byRxMode &= ~RCR_UNICAST;
> >                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wcmd: rx_mode = %x\n", pDevice->byRxMode);
> >                  BSSvAddMulticastNode(pDevice);
> > -                if (netif_queue_stopped(pDevice->dev)) {
> > +                if (netif_queue_stopped(pDevice->dev))
> >                      netif_wake_queue(pDevice->dev);
> > -                }
> >                  pDevice->bLinkPass = true;
> >                  ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
> >  		schedule_delayed_work(&pDevice->second_callback_work, HZ);
> > @@ -722,9 +715,8 @@ void vRunCommand(struct work_struct *work)
> >                          pDevice->bMoreData = true;
> >                      }
> >  
> > -                    if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0) {
> > +                    if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0)
> >                          DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Multicast ps tx fail \n");
> > -                    }
> >  
> >                      pMgmt->sNodeDBTable[0].wEnQueueCnt--;
> >                  }
> > @@ -747,9 +739,8 @@ void vRunCommand(struct work_struct *work)
> >                              pDevice->bMoreData = true;
> >                          }
> >  
> > -                        if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0) {
> > +                        if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0)
> >                              DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "sta ps tx fail \n");
> > -                        }
> >  
> >                          pMgmt->sNodeDBTable[ii].wEnQueueCnt--;
> >                          // check if sta ps enable, wait next pspoll
> > @@ -973,11 +964,10 @@ static int s_bCommandComplete(struct vnt_private *pDevice)
> >                  DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCommandState= WLAN_CMD_BSSID_SCAN\n");
> >                  pDevice->eCommandState = WLAN_CMD_SCAN_START;
> >                  pMgmt->uScanChannel = 0;
> > -                if (pSSID->len != 0) {
> > +                if (pSSID->len != 0)
> >                      memcpy(pMgmt->abyScanSSID, pSSID, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
> > -                } else {
> > +                else
> >                      memset(pMgmt->abyScanSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
> > -                }
> >  /*
> >                  if ((bForceSCAN == false) && (pDevice->bLinkPass == true)) {
> >                      if ((pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->len) &&
> > @@ -1054,9 +1044,8 @@ int bScheduleCommand(struct vnt_private *pDevice,
> >  		CMD_CODE eCommand, u8 *pbyItem0)
> >  {
> >  
> > -    if (pDevice->cbFreeCmdQueue == 0) {
> > +    if (pDevice->cbFreeCmdQueue == 0)
> >          return (false);
> > -    }
> >      pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].eCmd = eCommand;
> >      pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = true;
> >      memset(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID, 0 , WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
> > @@ -1094,11 +1083,9 @@ int bScheduleCommand(struct vnt_private *pDevice,
> >      ADD_ONE_WITH_WRAP_AROUND(pDevice->uCmdEnqueueIdx, CMD_Q_SIZE);
> >      pDevice->cbFreeCmdQueue--;
> >  
> > -    if (pDevice->bCmdRunning == false) {
> > +    if (pDevice->bCmdRunning == false)
> >          s_bCommandComplete(pDevice);
> > -    }
> > -    else {
> > -    }
> > +
> >      return (true);
> >  
> >  }
> > -- 
> > 1.7.9.5
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_out.
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
diff mbox

Patch

diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index ca57fc3..22d0038 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -108,9 +108,7 @@  static void vAdHocBeaconStop(struct vnt_private *pDevice)
             bStop = true;
         }
         if (pMgmt->uIBSSChannel >  CB_MAX_CHANNEL_24G)
-        {
             bStop = true;
-        }
     }
 
     if (bStop)
@@ -182,13 +180,13 @@  static void s_vProbeChannel(struct vnt_private *pDevice)
 	u8 *pbyRate;
 	int ii;
 
-    if (pDevice->byBBType == BB_TYPE_11A) {
-        pbyRate = &abyCurrSuppRatesA[0];
-    } else if (pDevice->byBBType == BB_TYPE_11B) {
-        pbyRate = &abyCurrSuppRatesB[0];
-    } else {
-        pbyRate = &abyCurrSuppRatesG[0];
-    }
+	if (pDevice->byBBType == BB_TYPE_11A)
+		pbyRate = &abyCurrSuppRatesA[0];
+	else if (pDevice->byBBType == BB_TYPE_11B)
+		pbyRate = &abyCurrSuppRatesB[0];
+	else
+		pbyRate = &abyCurrSuppRatesG[0];
+    
     // build an assocreq frame and send it
     pTxPacket = s_MgrMakeProbeRequest
                 (
@@ -204,10 +202,9 @@  static void s_vProbeChannel(struct vnt_private *pDevice)
         for (ii = 0; ii < 1; ii++) {
             if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING) {
                 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request sending fail.. \n");
-            }
-            else {
+	    } else {
                 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request is sending.. \n");
-            }
+	    }	
         }
     }
 
@@ -316,9 +313,8 @@  void vRunCommand(struct work_struct *work)
 
             pItemSSID = (PWLAN_IE_SSID)pMgmt->abyScanSSID;
 
-            if (pMgmt->uScanChannel == 0) {
+            if (pMgmt->uScanChannel == 0)
                 pMgmt->uScanChannel = pDevice->byMinChannel;
-            }
             if (pMgmt->uScanChannel > pDevice->byMaxChannel) {
 		pDevice->eCommandState = WLAN_CMD_SCAN_END;
                 s_bCommandComplete(pDevice);
@@ -546,9 +542,8 @@  void vRunCommand(struct work_struct *work)
             // if Adhoc mode
             else if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
                 if (pMgmt->eCurrState == WMAC_STATE_JOINTED) {
-                    if (netif_queue_stopped(pDevice->dev)) {
+                    if (netif_queue_stopped(pDevice->dev))
                         netif_wake_queue(pDevice->dev);
-                    }
                     pDevice->bLinkPass = true;
                     ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
                     pMgmt->sNodeDBTable[0].bActive = true;
@@ -654,9 +649,8 @@  void vRunCommand(struct work_struct *work)
                 ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
                 s_bClearBSSID_SCAN(pDevice);
 
-                if (netif_queue_stopped(pDevice->dev)) {
+                if (netif_queue_stopped(pDevice->dev))
                     netif_wake_queue(pDevice->dev);
-                }
 
             }
 	   else if (pMgmt->eCurrState < WMAC_STATE_ASSOCPENDING) {
@@ -700,9 +694,8 @@  void vRunCommand(struct work_struct *work)
                 pDevice->byRxMode &= ~RCR_UNICAST;
                 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wcmd: rx_mode = %x\n", pDevice->byRxMode);
                 BSSvAddMulticastNode(pDevice);
-                if (netif_queue_stopped(pDevice->dev)) {
+                if (netif_queue_stopped(pDevice->dev))
                     netif_wake_queue(pDevice->dev);
-                }
                 pDevice->bLinkPass = true;
                 ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
 		schedule_delayed_work(&pDevice->second_callback_work, HZ);
@@ -722,9 +715,8 @@  void vRunCommand(struct work_struct *work)
                         pDevice->bMoreData = true;
                     }
 
-                    if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0) {
+                    if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0)
                         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Multicast ps tx fail \n");
-                    }
 
                     pMgmt->sNodeDBTable[0].wEnQueueCnt--;
                 }
@@ -747,9 +739,8 @@  void vRunCommand(struct work_struct *work)
                             pDevice->bMoreData = true;
                         }
 
-                        if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0) {
+                        if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) != 0)
                             DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "sta ps tx fail \n");
-                        }
 
                         pMgmt->sNodeDBTable[ii].wEnQueueCnt--;
                         // check if sta ps enable, wait next pspoll
@@ -973,11 +964,10 @@  static int s_bCommandComplete(struct vnt_private *pDevice)
                 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCommandState= WLAN_CMD_BSSID_SCAN\n");
                 pDevice->eCommandState = WLAN_CMD_SCAN_START;
                 pMgmt->uScanChannel = 0;
-                if (pSSID->len != 0) {
+                if (pSSID->len != 0)
                     memcpy(pMgmt->abyScanSSID, pSSID, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
-                } else {
+                else
                     memset(pMgmt->abyScanSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
-                }
 /*
                 if ((bForceSCAN == false) && (pDevice->bLinkPass == true)) {
                     if ((pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->len) &&
@@ -1054,9 +1044,8 @@  int bScheduleCommand(struct vnt_private *pDevice,
 		CMD_CODE eCommand, u8 *pbyItem0)
 {
 
-    if (pDevice->cbFreeCmdQueue == 0) {
+    if (pDevice->cbFreeCmdQueue == 0)
         return (false);
-    }
     pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].eCmd = eCommand;
     pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = true;
     memset(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID, 0 , WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
@@ -1094,11 +1083,9 @@  int bScheduleCommand(struct vnt_private *pDevice,
     ADD_ONE_WITH_WRAP_AROUND(pDevice->uCmdEnqueueIdx, CMD_Q_SIZE);
     pDevice->cbFreeCmdQueue--;
 
-    if (pDevice->bCmdRunning == false) {
+    if (pDevice->bCmdRunning == false)
         s_bCommandComplete(pDevice);
-    }
-    else {
-    }
+
     return (true);
 
 }