Skip to content

Commit

Permalink
staging: rtl8192e: Fix UNNECESSARY_ELSE warning
Browse files Browse the repository at this point in the history
Fix checkpatch warnings 'else is not generally useful after a break or return'

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Mateusz Kulikowski authored and Greg Kroah-Hartman committed Apr 3, 2015
1 parent 28eb1f3 commit 285b7c0
Show file tree
Hide file tree
Showing 12 changed files with 482 additions and 518 deletions.
72 changes: 34 additions & 38 deletions drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2025,6 +2025,7 @@ bool rtl8192_rx_query_status_desc(struct net_device *dev,
struct sk_buff *skb)
{
struct r8192_priv *priv = rtllib_priv(dev);
struct rx_fwinfo *pDrvInfo = NULL;

stats->bICV = pdesc->ICV;
stats->bCRC = pdesc->CRC32;
Expand All @@ -2046,51 +2047,49 @@ bool rtl8192_rx_query_status_desc(struct net_device *dev,
priv->stats.rxcrcerrmid++;
}
return false;
} else {
struct rx_fwinfo *pDrvInfo = NULL;
}

stats->RxDrvInfoSize = pdesc->RxDrvInfoSize;
stats->RxBufShift = ((pdesc->Shift)&0x03);
stats->Decrypted = !pdesc->SWDec;
stats->RxDrvInfoSize = pdesc->RxDrvInfoSize;
stats->RxBufShift = ((pdesc->Shift)&0x03);
stats->Decrypted = !pdesc->SWDec;

pDrvInfo = (struct rx_fwinfo *)(skb->data + stats->RxBufShift);
pDrvInfo = (struct rx_fwinfo *)(skb->data + stats->RxBufShift);

stats->rate = HwRateToMRate90((bool)pDrvInfo->RxHT,
(u8)pDrvInfo->RxRate);
stats->bShortPreamble = pDrvInfo->SPLCP;
stats->rate = HwRateToMRate90((bool)pDrvInfo->RxHT,
(u8)pDrvInfo->RxRate);
stats->bShortPreamble = pDrvInfo->SPLCP;

rtl8192_UpdateReceivedRateHistogramStatistics(dev, stats);
rtl8192_UpdateReceivedRateHistogramStatistics(dev, stats);

stats->bIsAMPDU = (pDrvInfo->PartAggr == 1);
stats->bFirstMPDU = (pDrvInfo->PartAggr == 1) &&
(pDrvInfo->FirstAGGR == 1);
stats->bIsAMPDU = (pDrvInfo->PartAggr == 1);
stats->bFirstMPDU = (pDrvInfo->PartAggr == 1) &&
(pDrvInfo->FirstAGGR == 1);

stats->TimeStampLow = pDrvInfo->TSFL;
stats->TimeStampHigh = read_nic_dword(dev, TSFR+4);
stats->TimeStampLow = pDrvInfo->TSFL;
stats->TimeStampHigh = read_nic_dword(dev, TSFR+4);

rtl819x_UpdateRxPktTimeStamp(dev, stats);
rtl819x_UpdateRxPktTimeStamp(dev, stats);

if ((stats->RxBufShift + stats->RxDrvInfoSize) > 0)
stats->bShift = 1;
if ((stats->RxBufShift + stats->RxDrvInfoSize) > 0)
stats->bShift = 1;

stats->RxIs40MHzPacket = pDrvInfo->BW;
stats->RxIs40MHzPacket = pDrvInfo->BW;

rtl8192_TranslateRxSignalStuff(dev, skb, stats, pdesc,
pDrvInfo);
rtl8192_TranslateRxSignalStuff(dev, skb, stats, pdesc,
pDrvInfo);

if (pDrvInfo->FirstAGGR == 1 || pDrvInfo->PartAggr == 1)
RT_TRACE(COMP_RXDESC,
"pDrvInfo->FirstAGGR = %d, pDrvInfo->PartAggr = %d\n",
pDrvInfo->FirstAGGR, pDrvInfo->PartAggr);
skb_trim(skb, skb->len - 4/*sCrcLng*/);
if (pDrvInfo->FirstAGGR == 1 || pDrvInfo->PartAggr == 1)
RT_TRACE(COMP_RXDESC,
"pDrvInfo->FirstAGGR = %d, pDrvInfo->PartAggr = %d\n",
pDrvInfo->FirstAGGR, pDrvInfo->PartAggr);
skb_trim(skb, skb->len - 4/*sCrcLng*/);


stats->packetlength = stats->Length-4;
stats->fraglength = stats->packetlength;
stats->fragoffset = 0;
stats->ntotalfrag = 1;
return true;
}
stats->packetlength = stats->Length-4;
stats->fraglength = stats->packetlength;
stats->fragoffset = 0;
stats->ntotalfrag = 1;
return true;
}

void rtl8192_halt_adapter(struct net_device *dev, bool reset)
Expand Down Expand Up @@ -2314,22 +2313,19 @@ bool rtl8192_HalRxCheckStuck(struct net_device *dev)
(priv->undecorated_smoothed_pwdb >= RateAdaptiveTH_Low_20M)))) {
if (rx_chk_cnt < 2)
return bStuck;
else
rx_chk_cnt = 0;
rx_chk_cnt = 0;
} else if ((((priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) &&
(priv->undecorated_smoothed_pwdb < RateAdaptiveTH_Low_40M)) ||
((priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20) &&
(priv->undecorated_smoothed_pwdb < RateAdaptiveTH_Low_20M))) &&
priv->undecorated_smoothed_pwdb >= VeryLowRSSI) {
if (rx_chk_cnt < 4)
return bStuck;
else
rx_chk_cnt = 0;
rx_chk_cnt = 0;
} else {
if (rx_chk_cnt < 8)
return bStuck;
else
rx_chk_cnt = 0;
rx_chk_cnt = 0;
}


Expand Down
10 changes: 4 additions & 6 deletions drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,13 +940,11 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,
}

if (CurrentCmd && CurrentCmd->CmdID == CmdID_End) {
if ((*stage) == 2) {
if ((*stage) == 2)
return true;
} else {
(*stage)++;
(*step) = 0;
continue;
}
(*stage)++;
(*step) = 0;
continue;
}

if (!CurrentCmd)
Expand Down
7 changes: 3 additions & 4 deletions drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,10 @@ void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType,
RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",
__func__);
return;
} else {
down(&priv->rtllib->ips_sem);
IPSLeave(dev);
up(&priv->rtllib->ips_sem);
}
down(&priv->rtllib->ips_sem);
IPSLeave(dev);
up(&priv->rtllib->ips_sem);
}
}
priv->rtllib->is_set_key = true;
Expand Down
Loading

0 comments on commit 285b7c0

Please sign in to comment.