[PATCH] staging: rtl8188eu: remove return at end of void function call

2016-03-18 Thread Nicholas Sim
Remove unnecessary return statement from last line of void function call

Signed-off-by: Nicholas Sim 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 591a912..064721b 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -2105,7 +2105,6 @@ static void site_survey(struct adapter *padapter)
issue_action_BSSCoexistPacket(padapter);
issue_action_BSSCoexistPacket(padapter);
}
-   return;
 }
 
 /* collect bss info from Beacon and Probe request/response frames. */
-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: remove return at end of void function call

2016-03-23 Thread Nicholas Sim
Remove unnecessary return statements from last lines of void function call
(several)

Signed-off-by: Nicholas Sim 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 17 -
 1 file changed, 17 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 439c035..7f32b39 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -601,8 +601,6 @@ static void issue_probersp(struct adapter *padapter, 
unsigned char *da)
pattrib->last_txcmdsz = pattrib->pktlen;
 
dump_mgntframe(padapter, pmgntframe);
-
-   return;
 }
 
 static int issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid 
*pssid, u8 *da, bool wait_ack)
@@ -883,8 +881,6 @@ static void issue_auth(struct adapter *padapter, struct 
sta_info *psta,
rtw_wep_encrypt(padapter, (u8 *)pmgntframe);
DBG_88E("%s\n", __func__);
dump_mgntframe(padapter, pmgntframe);
-
-   return;
 }
 
 
@@ -1207,8 +1203,6 @@ exit:
rtw_buf_update(&pmlmepriv->assoc_req, 
&pmlmepriv->assoc_req_len, (u8 *)pwlanhdr, pattrib->pktlen);
else
rtw_buf_free(&pmlmepriv->assoc_req, &pmlmepriv->assoc_req_len);
-
-   return;
 }
 
 /* when wait_ack is true, this function should be called at process context */
@@ -4326,8 +4320,6 @@ void report_survey_event(struct adapter *padapter,
rtw_enqueue_cmd(pcmdpriv, pcmd_obj);
 
pmlmeext->sitesurvey_res.bss_cnt++;
-
-   return;
 }
 
 void report_surveydone_event(struct adapter *padapter)
@@ -4371,8 +4363,6 @@ void report_surveydone_event(struct adapter *padapter)
DBG_88E("survey done event(%x)\n", psurveydone_evt->bss_cnt);
 
rtw_enqueue_cmd(pcmdpriv, pcmd_obj);
-
-   return;
 }
 
 void report_join_res(struct adapter *padapter, int res)
@@ -4423,8 +4413,6 @@ void report_join_res(struct adapter *padapter, int res)
 
 
rtw_enqueue_cmd(pcmdpriv, pcmd_obj);
-
-   return;
 }
 
 void report_del_sta_event(struct adapter *padapter, unsigned char *MacAddr, 
unsigned short reason)
@@ -4480,8 +4468,6 @@ void report_del_sta_event(struct adapter *padapter, 
unsigned char *MacAddr, unsi
DBG_88E("report_del_sta_event: delete STA, mac_id =%d\n", mac_id);
 
rtw_enqueue_cmd(pcmdpriv, pcmd_obj);
-
-   return;
 }
 
 void report_add_sta_event(struct adapter *padapter, unsigned char *MacAddr, 
int cam_idx)
@@ -4526,8 +4512,6 @@ void report_add_sta_event(struct adapter *padapter, 
unsigned char *MacAddr, int
DBG_88E("report_add_sta_event: add STA\n");
 
rtw_enqueue_cmd(pcmdpriv, pcmd_obj);
-
-   return;
 }
 
 
@@ -4963,7 +4947,6 @@ void link_timer_hdl(unsigned long data)
issue_assocreq(padapter);
set_link_timer(pmlmeext, REASSOC_TO);
}
-   return;
 }
 
 void addba_timer_hdl(unsigned long data)
-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: xgifb: ensure braces on all arms of if stmt

2016-03-23 Thread Nicholas Sim
Added braces on else arm of if statement where if arm already has braces
as suggested for clarity in Documentation/CodingStyle

Signed-off-by: Nicholas Sim 
---
 drivers/staging/xgifb/vb_setmode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/xgifb/vb_setmode.c 
b/drivers/staging/xgifb/vb_setmode.c
index f97c77d..14230c2 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -3450,8 +3450,9 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned 
short ModeIdIndex,
if (!(pVBInfo->TVInfo &
(TVSetYPbPr525p | TVSetYPbPr750p)))
tempbx >>= 1;
-   } else
+   } else {
tempbx >>= 1;
+   }
}
 
tempbx -= 2;
-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: xgifb: remove extra braces from if stmt (single branch)

2016-03-23 Thread Nicholas Sim
Remove braces from one branch of if statement where both branches only
have a single line of code, as suggested in Documentation/CodingStyle

Signed-off-by: Nicholas Sim 
---
 drivers/staging/xgifb/vb_setmode.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/xgifb/vb_setmode.c 
b/drivers/staging/xgifb/vb_setmode.c
index 14230c2..40939c8 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -3840,9 +3840,9 @@ static void XGI_SetLCDRegs(unsigned short ModeIdIndex,
if (pVBInfo->VGAVDE == 525) {
if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B
| VB_SIS301LV | VB_SIS302LV
-   | VB_XGI301C)) {
+   | VB_XGI301C))
temp = 0xC6;
-   } else
+   else
temp = 0xC4;
 
xgifb_reg_set(pVBInfo->Part2Port, 0x2f, temp);
@@ -3852,9 +3852,9 @@ static void XGI_SetLCDRegs(unsigned short ModeIdIndex,
if (pVBInfo->VGAVDE == 420) {
if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B
| VB_SIS301LV | VB_SIS302LV
-   | VB_XGI301C)) {
+   | VB_XGI301C))
temp = 0x4F;
-   } else
+   else
temp = 0x4E;
xgifb_reg_set(pVBInfo->Part2Port, 0x2f, temp);
}
-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192u: remove blank lines before braces (closing)

2016-04-05 Thread Nicholas Sim
Remove unneeded blank lines occuring before closing braces

Signed-off-by: Nicholas Sim 
---
 drivers/staging/rtl8192u/r8192U_core.c | 35 --
 1 file changed, 35 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 849a95e..2f506b8 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -235,7 +235,6 @@ static void CamResetAllEntry(struct net_device *dev)
 */
ulcommand |= BIT(31) | BIT(30);
write_nic_dword(dev, RWCAM, ulcommand);
-
 }
 
 
@@ -319,8 +318,6 @@ void write_nic_byte(struct net_device *dev, int indx, u8 
data)
 
if (status < 0)
netdev_err(dev, "write_nic_byte TimeOut! status: %d\n", status);
-
-
 }
 
 
@@ -345,7 +342,6 @@ void write_nic_word(struct net_device *dev, int indx, u16 
data)
 
if (status < 0)
netdev_err(dev, "write_nic_word TimeOut! status: %d\n", status);
-
 }
 
 
@@ -372,7 +368,6 @@ void write_nic_dword(struct net_device *dev, int indx, u32 
data)
if (status < 0)
netdev_err(dev, "write_nic_dword TimeOut! status: %d\n",
   status);
-
 }
 
 
@@ -776,7 +771,6 @@ static u32 get_rxpacket_shiftbytes_819xusb(struct 
ieee80211_rx_stats *pstats)
 
return (sizeof(rx_desc_819x_usb) + pstats->RxDrvInfoSize
+ pstats->RxBufShift);
-
 }
 static int rtl8192_rx_initiate(struct net_device *dev)
 {
@@ -943,7 +937,6 @@ inline u16 ieeerate2rtlrate(int rate)
return 11;
default:
return 3;
-
}
 }
 static u16 rtl_rate[] = {10, 20, 55, 110, 60, 90, 120, 180, 240, 360, 480, 
540};
@@ -1149,7 +1142,6 @@ static void rtl8192_tx_isr(struct urb *tx_urb)
return; /* avoid further processing AMSDU */
}
}
-
 }
 
 static void rtl8192_config_rate(struct net_device *dev, u16 *rate_config)
@@ -1272,7 +1264,6 @@ static void rtl8192_update_cap(struct net_device *dev, 
u16 cap)
priv->slot_time = slot_time;
write_nic_byte(dev, SLOT_TIME, slot_time);
}
-
 }
 static void rtl8192_net_update(struct net_device *dev)
 {
@@ -1303,9 +1294,6 @@ static void rtl8192_net_update(struct net_device *dev)
 
write_nic_word(dev, BCN_TCFG, BcnTimeCfg);
}
-
-
-
 }
 
 /* temporary hw beacon is not used any more.
@@ -1782,7 +1770,6 @@ static short rtl8192_usb_initendpoints(struct net_device 
*dev)
 
netdev_dbg(dev, "End of initendpoints\n");
return 0;
-
 }
 #ifdef THOMAS_BEACON
 static void rtl8192_usb_deleteendpoints(struct net_device *dev)
@@ -1820,7 +1807,6 @@ void rtl8192_usb_deleteendpoints(struct net_device *dev)
}
kfree(priv->rx_urb);
priv->rx_urb = NULL;
-
}
 #else
kfree(priv->rx_urb);
@@ -1992,7 +1978,6 @@ static int rtl8192_handle_beacon(struct net_device *dev,
rtl8192_qos_handle_probe_response(priv, 1, network);
schedule_delayed_work(&priv->update_beacon_wq, 0);
return 0;
-
 }
 
 /*
@@ -2223,7 +2208,6 @@ static void rtl8192_SetWirelessMode(struct net_device 
*dev, u8 wireless_mode)
priv->ieee80211->pHTInfo->bEnableHT = 0;
RT_TRACE(COMP_INIT, "Current Wireless Mode is %x\n", wireless_mode);
rtl8192_refresh_supportrate(priv);
-
 }
 /* init priv variables here. only non_zero value should be initialized here. */
 static void rtl8192_init_priv_variable(struct net_device *dev)
@@ -2627,7 +2611,6 @@ static void rtl8192_read_eeprom_info(struct net_device 
*dev)
default:
priv->CustomerID = RT_CID_DEFAULT;
break;
-
}
 
switch (priv->CustomerID) {
@@ -2642,7 +2625,6 @@ static void rtl8192_read_eeprom_info(struct net_device 
*dev)
default:
priv->LedStrategy = SW_LED_MODE0;
break;
-
}
 
 
@@ -2797,8 +2779,6 @@ static void rtl8192_hwconfig(struct net_device *dev)
/* Set Tx Antenna including Feedback control */
 
/* Set Auto Rate fallback control */
-
-
 }
 
 
@@ -3037,7 +3017,6 @@ static bool rtl8192_adapter_start(struct net_device *dev)
priv->cck_present_attentuation_difference = 0;
priv->cck_present_attentuation =
priv->cck_present_attentuation_20Mdefault;
-
}
}
write_nic_byte(dev, 0x87, 0x0);
@@ -3222,7 +3201,6 @@ static RESET_TYPE rtl819x_ifcheck_resetornot(struct 
net_device *dev)
} else {
return RESET_TYPE_NORESET;
}
-
 }
 
 static void rtl8192_cancel_deferred_work(struct r8192_priv *priv);
@@ -3485,7 +3463,6 @@ static void rtl819x_watchdog_wqcallback(struct 
work_struct *work)
  

[PATCH] staging: rtl8192u: remove blank lines after braces (opening)

2016-04-05 Thread Nicholas Sim
Remove unneeded blank lines appearing after opening braces as suggested
by checkpatch.pl

Signed-off-by: Nicholas Sim 
---
 drivers/staging/rtl8192u/r8192U_core.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 2f506b8..21d5693 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -323,7 +323,6 @@ void write_nic_byte(struct net_device *dev, int indx, u8 
data)
 
 void write_nic_word(struct net_device *dev, int indx, u16 data)
 {
-
int status;
 
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
@@ -347,7 +346,6 @@ void write_nic_word(struct net_device *dev, int indx, u16 
data)
 
 void write_nic_dword(struct net_device *dev, int indx, u32 data)
 {
-
int status;
 
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
@@ -733,7 +731,6 @@ void rtl8192_update_msr(struct net_device *dev)
 * master (see the create BSS/IBSS func)
 */
if (priv->ieee80211->state == IEEE80211_LINKED) {
-
if (priv->ieee80211->iw_mode == IW_MODE_INFRA)
msr |= (MSR_LINK_MANAGED << MSR_LINK_SHIFT);
else if (priv->ieee80211->iw_mode == IW_MODE_ADHOC)
@@ -768,7 +765,6 @@ static void rtl8192_rx_isr(struct urb *urb);
 
 static u32 get_rxpacket_shiftbytes_819xusb(struct ieee80211_rx_stats *pstats)
 {
-
return (sizeof(rx_desc_819x_usb) + pstats->RxDrvInfoSize
+ pstats->RxBufShift);
 }
@@ -1267,7 +1263,6 @@ static void rtl8192_update_cap(struct net_device *dev, 
u16 cap)
 }
 static void rtl8192_net_update(struct net_device *dev)
 {
-
struct r8192_priv *priv = ieee80211_priv(dev);
struct ieee80211_network *net;
u16 BcnTimeCfg = 0, BcnCW = 6, BcnIFS = 0xf;
@@ -1725,7 +1720,6 @@ static short rtl8192_usb_initendpoints(struct net_device 
*dev)
 
 #ifndef JACKSON_NEW_RX
for (i = 0; i < (MAX_RX_URB + 1); i++) {
-
priv->rx_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
 
priv->rx_urb[i]->transfer_buffer =
@@ -2658,7 +2652,6 @@ static short rtl8192_get_channel_map(struct net_device 
*dev)
 
 static short rtl8192_init(struct net_device *dev)
 {
-
struct r8192_priv *priv = ieee80211_priv(dev);
 
memset(&(priv->stats), 0, sizeof(struct Stats));
@@ -3007,7 +3000,6 @@ static bool rtl8192_adapter_start(struct net_device *dev)
 bMaskByte2);
 
for (i = 0; i < CCKTxBBGainTableLength; i++) {
-
if (TempCCk == 
priv->cck_txbbgain_table[i].ccktxbb_valuearray[0]) {

priv->cck_present_attentuation_20Mdefault = (u8)i;
break;
@@ -3228,7 +3220,6 @@ static void CamRestoreAllEntry(struct net_device *dev)
 
if ((priv->ieee80211->pairwise_key_type == KEY_TYPE_WEP40) ||
(priv->ieee80211->pairwise_key_type == KEY_TYPE_WEP104)) {
-
for (EntryId = 0; EntryId < 4; EntryId++) {
MacAddr = CAM_CONST_ADDR[EntryId];
setKey(dev, EntryId, EntryId,
@@ -3237,7 +3228,6 @@ static void CamRestoreAllEntry(struct net_device *dev)
}
 
} else if (priv->ieee80211->pairwise_key_type == KEY_TYPE_TKIP) {
-
if (priv->ieee80211->iw_mode == IW_MODE_ADHOC)
setKey(dev, 4, 0, priv->ieee80211->pairwise_key_type,
   (u8 *)dev->dev_addr, 0, NULL);
@@ -3245,7 +3235,6 @@ static void CamRestoreAllEntry(struct net_device *dev)
setKey(dev, 4, 0, priv->ieee80211->pairwise_key_type,
   MacAddr, 0, NULL);
} else if (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP) {
-
if (priv->ieee80211->iw_mode == IW_MODE_ADHOC)
setKey(dev, 4, 0, priv->ieee80211->pairwise_key_type,
   (u8 *)dev->dev_addr, 0, NULL);
@@ -3446,7 +3435,6 @@ static void rtl819x_watchdog_wqcallback(struct 
work_struct *work)
/* for AP roaming */
if (priv->ieee80211->state == IEEE80211_LINKED &&
priv->ieee80211->iw_mode == IW_MODE_INFRA) {
-
rtl819x_update_rxcounts(priv, &TotalRxBcnNum, &TotalRxDataNum);
if ((TotalRxBcnNum + TotalRxDataNum) == 0) {
 #ifdef TODO
@@ -4865,7 +4853,6 @@ static void rtl8192_rx_cmd(struct sk_buff *skb)
};
 
if ((skb->len >= (20 + sizeof(rx_desc_819x_usb))) && (skb->len < 
RX_URB_SIZE)) {
-
query_rx_cmdpkt_desc_status(skb, &stats);
/* prfd->queue_id = 1; */
 
@@ -5

[PATCH] staging: rtl8192u: add blank line after declarations

2016-04-05 Thread Nicholas Sim
Add a blank line after function/struct/union/enum declarations for
readability, as suggested in Documentation/CodingStyle

Signed-off-by: Nicholas Sim 
---
 drivers/staging/rtl8192u/r8192U_core.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 21d5693..9b319b3 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -297,6 +297,7 @@ int read_nic_byte_E(struct net_device *dev, int indx, u8 
*data)
 
return 0;
 }
+
 /* as 92U has extend page from 4 to 16, so modify functions below. */
 void write_nic_byte(struct net_device *dev, int indx, u8 data)
 {
@@ -768,6 +769,7 @@ static u32 get_rxpacket_shiftbytes_819xusb(struct 
ieee80211_rx_stats *pstats)
return (sizeof(rx_desc_819x_usb) + pstats->RxDrvInfoSize
+ pstats->RxBufShift);
 }
+
 static int rtl8192_rx_initiate(struct net_device *dev)
 {
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
@@ -864,6 +866,7 @@ void rtl8192_set_rxconf(struct net_device *dev)
 
write_nic_dword(dev, RCR, rxconf);
 }
+
 /* wait to be removed */
 void rtl8192_rx_enable(struct net_device *dev)
 {
@@ -935,6 +938,7 @@ inline u16 ieeerate2rtlrate(int rate)
return 3;
}
 }
+
 static u16 rtl_rate[] = {10, 20, 55, 110, 60, 90, 120, 180, 240, 360, 480, 
540};
 inline u16 rtl8192_rate2rate(short rate)
 {
@@ -1261,6 +1265,7 @@ static void rtl8192_update_cap(struct net_device *dev, 
u16 cap)
write_nic_byte(dev, SLOT_TIME, slot_time);
}
 }
+
 static void rtl8192_net_update(struct net_device *dev)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
@@ -1298,6 +1303,7 @@ void rtl819xusb_beacon_tx(struct net_device *dev, u16  
tx_rate)
 {
 
 }
+
 inline u8 rtl8192_IsWirelessBMode(u16 rate)
 {
if (((rate <= 110) && (rate != 60) && (rate != 90)) || (rate == 220))
@@ -1765,6 +1771,7 @@ static short rtl8192_usb_initendpoints(struct net_device 
*dev)
netdev_dbg(dev, "End of initendpoints\n");
return 0;
 }
+
 #ifdef THOMAS_BEACON
 static void rtl8192_usb_deleteendpoints(struct net_device *dev)
 {
@@ -1868,6 +1875,7 @@ static void rtl8192_update_beacon(struct work_struct 
*work)
net->bssht.bdRT2RTLongSlotTime;
rtl8192_update_cap(dev, net->capability);
 }
+
 /*
 * background support to run QoS activate functionality
 */
@@ -2161,6 +2169,7 @@ static u8 rtl8192_getSupportedWireleeMode(struct 
net_device *dev)
}
return ret;
 }
+
 static void rtl8192_SetWirelessMode(struct net_device *dev, u8 wireless_mode)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
@@ -2203,6 +2212,7 @@ static void rtl8192_SetWirelessMode(struct net_device 
*dev, u8 wireless_mode)
RT_TRACE(COMP_INIT, "Current Wireless Mode is %x\n", wireless_mode);
rtl8192_refresh_supportrate(priv);
 }
+
 /* init priv variables here. only non_zero value should be initialized here. */
 static void rtl8192_init_priv_variable(struct net_device *dev)
 {
@@ -2410,6 +2420,7 @@ static inline u16 endian_swap(u16 *data)
*data = (tmp >> 8) | (tmp << 8);
return *data;
 }
+
 static void rtl8192_read_eeprom_info(struct net_device *dev)
 {
u16 wEPROM_ID = 0;
@@ -3268,6 +3279,7 @@ static void CamRestoreAllEntry(struct net_device *dev)
   CAM_CONST_ADDR[0], 0, NULL);
}
 }
+
 /* This function is used to fix Tx/Rx stop bug temporarily.
  * This function will do "system reset" to NIC when Tx or Rx is stuck.
  * The method checking Tx/Rx stuck of this function is supported by FW,
@@ -3485,6 +3497,7 @@ static void watch_dog_timer_callback(unsigned long data)
mod_timer(&priv->watch_dog_timer,
  jiffies + msecs_to_jiffies(IEEE80211_WATCH_DOG_TIME));
 }
+
 static int _rtl8192_up(struct net_device *dev)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
@@ -4159,6 +4172,7 @@ static u8 rtl819x_evm_dbtopercentage(char value)
ret_val = 100;
return ret_val;
 }
+
 /* We want good-looking for signal strength/quality */
 static long rtl819x_signal_scale_mapping(long currsig)
 {
-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192u: rewrite NULL comparison for pointers

2016-04-05 Thread Nicholas Sim
When testing pointers, it is not necessary to explicitly compare to
NULL. Rewrite if condition as (!ptr) or (ptr) as suggested in
Documentation/CodingStyle

Signed-off-by: Nicholas Sim 
---
 drivers/staging/rtl8192u/r8192U_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 9b319b3..dba52741 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1994,7 +1994,7 @@ static int rtl8192_qos_association_resp(struct r8192_priv 
*priv,
u32 size = sizeof(struct ieee80211_qos_parameters);
int set_qos_param = 0;
 
-   if ((priv == NULL) || (network == NULL))
+   if (!priv || !network)
return 0;
 
if (priv->ieee80211->state != IEEE80211_LINKED)
@@ -4938,7 +4938,7 @@ static int rtl8192_usb_probe(struct usb_interface *intf,
RT_TRACE(COMP_INIT, "Oops: i'm coming\n");
 
dev = alloc_ieee80211(sizeof(struct r8192_priv));
-   if (dev == NULL)
+   if (!dev)
return -ENOMEM;
 
usb_set_intfdata(intf, dev);
@@ -5157,7 +5157,7 @@ void setKey(struct net_device *dev, u8 EntryNo, u8 
KeyIndex, u16 KeyType,
write_nic_dword(dev, RWCAM, TargetCommand);
} else {
/* Key Material */
-   if (KeyContent != NULL) {
+   if (KeyContent) {
write_nic_dword(dev, WCAMI, (u32)(*(KeyContent 
+ i - 2)));
write_nic_dword(dev, RWCAM, TargetCommand);
}
-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rts5208: ensure braces on all arms of if stmt

2016-04-05 Thread Nicholas Sim
Added braces on if arm of if statement where else arm already needs braces
as suggested for clarity in Documentation/CodingStyle

Signed-off-by: Nicholas Sim 
---
 drivers/staging/rts5208/ms.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c
index 3e75db7..2ad4ea0 100644
--- a/drivers/staging/rts5208/ms.c
+++ b/drivers/staging/rts5208/ms.c
@@ -794,8 +794,9 @@ static int ms_confirm_cpu_startup(struct rtsx_chip *chip)
}
 
if (val & INT_REG_ERR) {
-   if (val & INT_REG_CMDNK)
+   if (val & INT_REG_CMDNK) {
chip->card_wp |= (MS_CARD);
+   }
else {
rtsx_trace(chip);
return STATUS_FAIL;
-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: wlan-ng: rewrite NULL comparison

2016-04-05 Thread Nicholas Sim
It is not necessary to compare explicitly to NULL. Rewrite if condition
as (!dev) or (dev) as suggested in Documentation/CodingStyle

Signed-off-by: Nicholas Sim 
---
 drivers/staging/wlan-ng/hfa384x_usb.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c 
b/drivers/staging/wlan-ng/hfa384x_usb.c
index 21a92df..3378107 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -614,7 +614,7 @@ static hfa384x_usbctlx_t *usbctlx_alloc(void)
 
ctlx = kzalloc(sizeof(*ctlx),
   in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
-   if (ctlx != NULL)
+   if (ctlx)
init_completion(&ctlx->done);
 
return ctlx;
@@ -797,7 +797,7 @@ static inline struct usbctlx_completor *init_rmem_completor(
 */
 static void hfa384x_cb_status(hfa384x_t *hw, const hfa384x_usbctlx_t *ctlx)
 {
-   if (ctlx->usercb != NULL) {
+   if (ctlx->usercb) {
hfa384x_cmdresult_t cmdresult;
 
if (ctlx->state != CTLX_COMPLETE) {
@@ -2738,7 +2738,7 @@ static void hfa384x_usbctlx_completion_task(unsigned long 
data)
/* Call the completion function that this
 * command was assigned, assuming it has one.
 */
-   if (ctlx->cmdcb != NULL) {
+   if (ctlx->cmdcb) {
spin_unlock_irqrestore(&hw->ctlxq.lock, flags);
ctlx->cmdcb(hw, ctlx);
spin_lock_irqsave(&hw->ctlxq.lock, flags);
@@ -3629,7 +3629,7 @@ static void hfa384x_ctlxout_callback(struct urb *urb)
dbprint_urb(urb);
 #endif
if ((urb->status == -ESHUTDOWN) ||
-   (urb->status == -ENODEV) || (hw == NULL))
+   (urb->status == -ENODEV) || !hw)
return;
 
 retry:
-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rts5208: ensure braces on all arms of if stmt

2016-04-05 Thread Nicholas Sim
Added braces on if arm of if statement where else arm already needs
braces as suggested for clarity in Documentation/CodingStyle (several)

Signed-off-by: Nicholas Sim 
---
 drivers/staging/rts5208/sd.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
index 87d6976..6219e04 100644
--- a/drivers/staging/rts5208/sd.c
+++ b/drivers/staging/rts5208/sd.c
@@ -1928,9 +1928,9 @@ static int sd_tuning_rx(struct rtsx_chip *chip)
tuning_cmd = sd_sdr_tuning_rx_cmd;
 
} else {
-   if (CHK_MMC_DDR52(sd_card))
+   if (CHK_MMC_DDR52(sd_card)) {
tuning_cmd = mmc_ddr_tunning_rx_cmd;
-   else {
+   } else {
rtsx_trace(chip);
return STATUS_FAIL;
}
@@ -2054,9 +2054,9 @@ static int sd_tuning_tx(struct rtsx_chip *chip)
tuning_cmd = sd_sdr_tuning_tx_cmd;
 
} else {
-   if (CHK_MMC_DDR52(sd_card))
+   if (CHK_MMC_DDR52(sd_card)) {
tuning_cmd = sd_ddr_tuning_tx_cmd;
-   else {
+   } else {
rtsx_trace(chip);
return STATUS_FAIL;
}
@@ -2678,9 +2678,9 @@ RTY_SD_RST:
}
 
j++;
-   if (j < 3)
+   if (j < 3) {
goto RTY_SD_RST;
-   else {
+   } else {
rtsx_trace(chip);
return STATUS_FAIL;
}
@@ -2690,9 +2690,9 @@ RTY_SD_RST:
SD_RSP_TYPE_R3, rsp, 5);
if (retval != STATUS_SUCCESS) {
k++;
-   if (k < 3)
+   if (k < 3) {
goto RTY_SD_RST;
-   else {
+   } else {
rtsx_trace(chip);
return STATUS_FAIL;
}
-- 
2.4.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel