mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-06 04:19:23 -04:00
staging: r8188eu: clean up comparsions to NULL in hal directory
Clean up comparsions to NULL in the hal directory reported by checkpatch. x == NULL -> !x x != NULL -> x Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210801084614.4328-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
11e14fc3e4
commit
725a3f1c4d
@@ -486,7 +486,7 @@ int ODM_RAInfo_Init(struct odm_dm_struct *dm_odm, u8 macid)
|
||||
struct odm_ra_info *pRaInfo = &dm_odm->RAInfo[macid];
|
||||
u8 WirelessMode = 0xFF; /* invalid value */
|
||||
u8 max_rate_idx = 0x13; /* MCS7 */
|
||||
if (dm_odm->pWirelessMode != NULL)
|
||||
if (dm_odm->pWirelessMode)
|
||||
WirelessMode = *(dm_odm->pWirelessMode);
|
||||
|
||||
if (WirelessMode != 0xFF) {
|
||||
|
||||
@@ -195,7 +195,7 @@ enum HAL_STATUS ODM_ReadAndConfig_AGC_TAB_1T_8188E(struct odm_dm_struct *dm_odm)
|
||||
|
||||
if (biol) {
|
||||
pxmit_frame = rtw_IOL_accquire_xmit_frame(adapter);
|
||||
if (pxmit_frame == NULL) {
|
||||
if (!pxmit_frame) {
|
||||
pr_info("rtw_IOL_accquire_xmit_frame failed\n");
|
||||
return HAL_STATUS_FAILURE;
|
||||
}
|
||||
@@ -474,7 +474,7 @@ enum HAL_STATUS ODM_ReadAndConfig_PHY_REG_1T_8188E(struct odm_dm_struct *dm_odm)
|
||||
|
||||
if (biol) {
|
||||
pxmit_frame = rtw_IOL_accquire_xmit_frame(adapter);
|
||||
if (pxmit_frame == NULL) {
|
||||
if (!pxmit_frame) {
|
||||
pr_info("rtw_IOL_accquire_xmit_frame failed\n");
|
||||
return HAL_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm)
|
||||
|
||||
if (biol) {
|
||||
pxmit_frame = rtw_IOL_accquire_xmit_frame(adapt);
|
||||
if (pxmit_frame == NULL) {
|
||||
if (!pxmit_frame) {
|
||||
pr_info("rtw_IOL_accquire_xmit_frame failed\n");
|
||||
return HAL_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ enum HAL_STATUS ODM_ReadAndConfig_RadioA_1T_8188E(struct odm_dm_struct *pDM_Odm)
|
||||
|
||||
if (biol) {
|
||||
pxmit_frame = rtw_IOL_accquire_xmit_frame(Adapter);
|
||||
if (pxmit_frame == NULL) {
|
||||
if (!pxmit_frame) {
|
||||
pr_info("rtw_IOL_accquire_xmit_frame failed\n");
|
||||
return HAL_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ s32 c2h_evt_read(struct adapter *adapter, u8 *buf)
|
||||
int i;
|
||||
u8 trigger;
|
||||
|
||||
if (buf == NULL)
|
||||
if (!buf)
|
||||
goto exit;
|
||||
|
||||
trigger = rtw_read8(adapter, REG_C2HEVT_CLEAR);
|
||||
|
||||
@@ -224,14 +224,14 @@ s32 rtw_hal_mgnt_xmit(struct adapter *adapt, struct xmit_frame *pmgntframe)
|
||||
|
||||
s32 rtw_hal_init_xmit_priv(struct adapter *adapt)
|
||||
{
|
||||
if (adapt->HalFunc.init_xmit_priv != NULL)
|
||||
if (adapt->HalFunc.init_xmit_priv)
|
||||
return adapt->HalFunc.init_xmit_priv(adapt);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
void rtw_hal_free_xmit_priv(struct adapter *adapt)
|
||||
{
|
||||
if (adapt->HalFunc.free_xmit_priv != NULL)
|
||||
if (adapt->HalFunc.free_xmit_priv)
|
||||
adapt->HalFunc.free_xmit_priv(adapt);
|
||||
}
|
||||
|
||||
|
||||
@@ -490,7 +490,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)
|
||||
|
||||
DBG_88E("%s\n", __func__);
|
||||
ReservedPagePacket = (u8 *)rtw_zmalloc(1000);
|
||||
if (ReservedPagePacket == NULL) {
|
||||
if (!ReservedPagePacket) {
|
||||
DBG_88E("%s: alloc ReservedPagePacket fail!\n", __func__);
|
||||
return;
|
||||
}
|
||||
@@ -559,7 +559,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)
|
||||
|
||||
TotalPacketLen = BufIndex + QosNullLength;
|
||||
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
|
||||
if (pmgntframe == NULL)
|
||||
if (!pmgntframe)
|
||||
goto exit;
|
||||
|
||||
/* update attribute */
|
||||
|
||||
@@ -77,13 +77,13 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf)
|
||||
u8 u1temp = 0;
|
||||
|
||||
efuseTbl = (u8 *)rtw_zmalloc(EFUSE_MAP_LEN_88E);
|
||||
if (efuseTbl == NULL) {
|
||||
if (!efuseTbl) {
|
||||
DBG_88E("%s: alloc efuseTbl fail!\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
eFuseWord = (u16 **)rtw_malloc2d(EFUSE_MAX_SECTION_88E, EFUSE_MAX_WORD_UNIT, sizeof(u16));
|
||||
if (eFuseWord == NULL) {
|
||||
if (!eFuseWord) {
|
||||
DBG_88E("%s: alloc eFuseWord fail!\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
@@ -811,13 +811,13 @@ static void Hal_EfuseReadEFuse88E(struct adapter *Adapter,
|
||||
}
|
||||
|
||||
efuseTbl = (u8 *)rtw_zmalloc(EFUSE_MAP_LEN_88E);
|
||||
if (efuseTbl == NULL) {
|
||||
if (!efuseTbl) {
|
||||
DBG_88E("%s: alloc efuseTbl fail!\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
eFuseWord = (u16 **)rtw_malloc2d(EFUSE_MAX_SECTION_88E, EFUSE_MAX_WORD_UNIT, sizeof(u16));
|
||||
if (eFuseWord == NULL) {
|
||||
if (!eFuseWord) {
|
||||
DBG_88E("%s: alloc eFuseWord fail!\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
@@ -1240,7 +1240,7 @@ static int hal_EfusePgPacketRead_8188e(struct adapter *pAdapter, u8 offset, u8 *
|
||||
|
||||
EFUSE_GetEfuseDefinition(pAdapter, EFUSE_WIFI, TYPE_EFUSE_MAX_SECTION, (void *)&max_section, bPseudoTest);
|
||||
|
||||
if (data == NULL)
|
||||
if (!data)
|
||||
return false;
|
||||
if (offset > max_section)
|
||||
return false;
|
||||
|
||||
@@ -28,7 +28,7 @@ static void process_link_qual(struct adapter *padapter, struct recv_frame *prfra
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
struct signal_stat *signal_stat;
|
||||
|
||||
if (prframe == NULL || padapter == NULL)
|
||||
if (!prframe || !padapter)
|
||||
return;
|
||||
|
||||
pattrib = &prframe->attrib;
|
||||
|
||||
@@ -45,7 +45,7 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter)
|
||||
_rtw_init_queue(&precvpriv->free_recv_buf_queue);
|
||||
|
||||
precvpriv->pallocated_recv_buf = rtw_zmalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4);
|
||||
if (precvpriv->pallocated_recv_buf == NULL) {
|
||||
if (!precvpriv->pallocated_recv_buf) {
|
||||
res = _FAIL;
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("alloc recv_buf fail!\n"));
|
||||
goto exit;
|
||||
|
||||
@@ -444,9 +444,9 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp
|
||||
RT_TRACE(_module_rtl8192c_xmit_c_, _drv_info_, ("+xmitframe_complete\n"));
|
||||
|
||||
/* check xmitbuffer is ok */
|
||||
if (pxmitbuf == NULL) {
|
||||
if (!pxmitbuf) {
|
||||
pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
|
||||
if (pxmitbuf == NULL)
|
||||
if (!pxmitbuf)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -455,7 +455,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
|
||||
pxmitframe = rtw_dequeue_xframe(pxmitpriv, pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry);
|
||||
if (pxmitframe == NULL) {
|
||||
if (!pxmitframe) {
|
||||
/* no more xmit frame, release xmit buffer */
|
||||
rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
|
||||
return false;
|
||||
@@ -638,7 +638,7 @@ static s32 pre_xmitframe(struct adapter *adapt, struct xmit_frame *pxmitframe)
|
||||
goto enqueue;
|
||||
|
||||
pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
|
||||
if (pxmitbuf == NULL)
|
||||
if (!pxmitbuf)
|
||||
goto enqueue;
|
||||
|
||||
spin_unlock_bh(&pxmitpriv->lock);
|
||||
|
||||
@@ -2117,7 +2117,7 @@ static void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_l
|
||||
if (mac_id >= NUM_STA) /* CAM_SIZE */
|
||||
return;
|
||||
psta = pmlmeinfo->FW_sta_info[mac_id].psta;
|
||||
if (psta == NULL)
|
||||
if (!psta)
|
||||
return;
|
||||
switch (mac_id) {
|
||||
case 0:/* for infra mode */
|
||||
@@ -2253,7 +2253,7 @@ void rtl8188eu_set_hal_ops(struct adapter *adapt)
|
||||
struct hal_ops *halfunc = &adapt->HalFunc;
|
||||
|
||||
adapt->HalData = rtw_zmalloc(sizeof(struct hal_data_8188e));
|
||||
if (adapt->HalData == NULL)
|
||||
if (!adapt->HalData)
|
||||
DBG_88E("cant not alloc memory for HAL DATA\n");
|
||||
adapt->hal_data_sz = sizeof(struct hal_data_8188e);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
|
||||
/* Acquire IO memory for vendorreq */
|
||||
pIo_buf = dvobjpriv->usb_vendor_req_buf;
|
||||
|
||||
if (pIo_buf == NULL) {
|
||||
if (!pIo_buf) {
|
||||
DBG_88E("[%s] pIo_buf == NULL\n", __func__);
|
||||
status = -ENOMEM;
|
||||
goto release_mutex;
|
||||
@@ -318,7 +318,7 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
|
||||
prxstat = (struct recv_stat *)pbuf;
|
||||
|
||||
precvframe = rtw_alloc_recvframe(pfree_recv_queue);
|
||||
if (precvframe == NULL) {
|
||||
if (!precvframe) {
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvbuf2recvframe: precvframe==NULL\n"));
|
||||
DBG_88E("%s()-%d: rtw_alloc_recvframe() failed! RX Drop!\n", __func__, __LINE__);
|
||||
goto _exit_recvbuf2recvframe;
|
||||
@@ -587,18 +587,18 @@ static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
if ((!precvbuf->reuse) || (precvbuf->pskb == NULL)) {
|
||||
if (!precvbuf->reuse || !precvbuf->pskb) {
|
||||
precvbuf->pskb = skb_dequeue(&precvpriv->free_recv_skb_queue);
|
||||
if (NULL != precvbuf->pskb)
|
||||
if (precvbuf->pskb)
|
||||
precvbuf->reuse = true;
|
||||
}
|
||||
|
||||
rtl8188eu_init_recvbuf(adapter, precvbuf);
|
||||
|
||||
/* re-assign for linux based on skb */
|
||||
if ((!precvbuf->reuse) || (precvbuf->pskb == NULL)) {
|
||||
if (!precvbuf->reuse || !precvbuf->pskb) {
|
||||
precvbuf->pskb = netdev_alloc_skb(adapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
|
||||
if (precvbuf->pskb == NULL) {
|
||||
if (!precvbuf->pskb) {
|
||||
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("init_recvbuf(): alloc_skb fail!\n"));
|
||||
DBG_88E("#### usb_read_port() alloc_skb fail!#####\n");
|
||||
return _FAIL;
|
||||
|
||||
Reference in New Issue
Block a user