2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-30 16:13:54 +08:00

staging: rtl8188eu: fix comparsions to NULL - style

Use x instead of x != NULL.
Use !x instead of x == NULL.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Michael Straube 2018-07-31 13:34:11 +02:00 committed by Greg Kroah-Hartman
parent 4235d7d88a
commit 55e12d6451
4 changed files with 10 additions and 10 deletions
drivers/staging/rtl8188eu/os_dep

View File

@ -311,7 +311,7 @@ struct net_device *rtw_init_netdev(struct adapter *old_padapter)
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+init_net_dev\n")); RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+init_net_dev\n"));
if (old_padapter != NULL) if (old_padapter)
pnetdev = rtw_alloc_etherdev_with_old_priv((void *)old_padapter); pnetdev = rtw_alloc_etherdev_with_old_priv((void *)old_padapter);
if (!pnetdev) if (!pnetdev)

View File

@ -325,7 +325,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
int status = _FAIL; int status = _FAIL;
padapter = vzalloc(sizeof(*padapter)); padapter = vzalloc(sizeof(*padapter));
if (padapter == NULL) if (!padapter)
goto exit; goto exit;
padapter->dvobj = dvobj; padapter->dvobj = dvobj;
dvobj->if1 = padapter; dvobj->if1 = padapter;
@ -334,14 +334,14 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
mutex_init(&padapter->hw_init_mutex); mutex_init(&padapter->hw_init_mutex);
pnetdev = rtw_init_netdev(padapter); pnetdev = rtw_init_netdev(padapter);
if (pnetdev == NULL) if (!pnetdev)
goto free_adapter; goto free_adapter;
SET_NETDEV_DEV(pnetdev, dvobj_to_dev(dvobj)); SET_NETDEV_DEV(pnetdev, dvobj_to_dev(dvobj));
padapter = rtw_netdev_priv(pnetdev); padapter = rtw_netdev_priv(pnetdev);
if (padapter->registrypriv.monitor_enable) { if (padapter->registrypriv.monitor_enable) {
pmondev = rtl88eu_mon_init(); pmondev = rtl88eu_mon_init();
if (pmondev == NULL) if (!pmondev)
netdev_warn(pnetdev, "Failed to initialize monitor interface"); netdev_warn(pnetdev, "Failed to initialize monitor interface");
padapter->pmondev = pmondev; padapter->pmondev = pmondev;
} }

View File

@ -58,7 +58,7 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
prxstat = (struct recv_stat *)pbuf; prxstat = (struct recv_stat *)pbuf;
precvframe = rtw_alloc_recvframe(pfree_recv_queue); precvframe = rtw_alloc_recvframe(pfree_recv_queue);
if (precvframe == NULL) { if (!precvframe) {
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvbuf2recvframe: precvframe==NULL\n")); 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__); DBG_88E("%s()-%d: rtw_alloc_recvframe() failed! RX Drop!\n", __func__, __LINE__);
goto _exit_recvbuf2recvframe; goto _exit_recvbuf2recvframe;
@ -436,16 +436,16 @@ u32 usb_read_port(struct adapter *adapter, u32 addr, struct recv_buf *precvbuf)
return _FAIL; return _FAIL;
} }
if ((!precvbuf->reuse) || (precvbuf->pskb == NULL)) { if ((!precvbuf->reuse) || (!precvbuf->pskb)) {
precvbuf->pskb = skb_dequeue(&precvpriv->free_recv_skb_queue); precvbuf->pskb = skb_dequeue(&precvpriv->free_recv_skb_queue);
if (precvbuf->pskb != NULL) if (precvbuf->pskb)
precvbuf->reuse = true; precvbuf->reuse = true;
} }
/* re-assign for linux based on skb */ /* 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); precvbuf->pskb = netdev_alloc_skb(adapter->pnetdev, MAX_RECVBUF_SZ);
if (precvbuf->pskb == NULL) { if (!precvbuf->pskb) {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("init_recvbuf(): alloc_skb fail!\n")); RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("init_recvbuf(): alloc_skb fail!\n"));
DBG_88E("#### usb_read_port() alloc_skb fail!#####\n"); DBG_88E("#### usb_read_port() alloc_skb fail!#####\n");
return _FAIL; return _FAIL;

View File

@ -19,7 +19,7 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb
int i; int i;
pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL); pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL);
if (pxmitbuf->pallocated_buf == NULL) if (!pxmitbuf->pallocated_buf)
return _FAIL; return _FAIL;
pxmitbuf->pbuf = PTR_ALIGN(pxmitbuf->pallocated_buf, XMITBUF_ALIGN_SZ); pxmitbuf->pbuf = PTR_ALIGN(pxmitbuf->pallocated_buf, XMITBUF_ALIGN_SZ);