u8 null_ip[4] = {0};
char wlan_dev_name[5] = "wlan0";
- if (dev_iface == NULL || dev_iface->ifa_dev == NULL || dev_iface->ifa_dev->dev == NULL) {
+ if (!dev_iface || !dev_iface->ifa_dev || !dev_iface->ifa_dev->dev) {
PRINT_D(GENERIC_DBG, "dev_iface = NULL\n");
return NOTIFY_DONE;
}
}
dev = (struct net_device *)dev_iface->ifa_dev->dev;
- if (dev->ieee80211_ptr == NULL || dev->ieee80211_ptr->wiphy == NULL) {
+ if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy) {
PRINT_D(GENERIC_DBG, "No Wireless registerd\n");
return NOTIFY_DONE;
}
priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
- if (priv == NULL) {
+ if (!priv) {
PRINT_D(GENERIC_DBG, "No Wireless Priv\n");
return NOTIFY_DONE;
}
pstrWFIDrv = (struct host_if_drv *)priv->hWILCWFIDrv;
nic = netdev_priv(dev);
- if (nic == NULL || pstrWFIDrv == NULL) {
+ if (!nic || !pstrWFIDrv) {
PRINT_D(GENERIC_DBG, "No Wireless Priv\n");
return NOTIFY_DONE;
}
int error = -1;
PRINT_D(LOCK_DBG, "Locking %p\n", vp);
- if (vp != NULL)
+ if (vp)
error = down_timeout((struct semaphore *)vp, msecs_to_jiffies(timeout));
else
PRINT_ER("Failed, mutex is NULL\n");
firmware = P2P_CONCURRENCY_FIRMWARE;
}
- if (nic == NULL) {
+ if (!nic) {
PRINT_ER("NIC is NULL\n");
goto _fail_;
}
- if (&nic->wilc_netdev->dev == NULL) {
+ if (!(&nic->wilc_netdev->dev)) {
PRINT_ER("&nic->wilc_netdev->dev is NULL\n");
goto _fail_;
}
disable_sdio_interrupt();
mutex_unlock(&wl->hif_cs);
#endif
- if (&wl->txq_event != NULL)
+ if (&wl->txq_event)
up(&wl->txq_event);
PRINT_D(INIT_DBG, "Deinitializing Threads\n");
PRINT_D(INIT_DBG, "De-Initializing Locks\n");
- if (&wilc->hif_cs != NULL)
+ if (&wilc->hif_cs)
mutex_destroy(&wilc->hif_cs);
- if (&wilc->rxq_cs != NULL)
+ if (&wilc->rxq_cs)
mutex_destroy(&wilc->rxq_cs);
return 0;
wl->close = 1;
PRINT_D(INIT_DBG, "Deinitializing Threads\n");
- if (&wl->txq_event != NULL)
+ if (&wl->txq_event)
up(&wl->txq_event);
- if (wl->txq_thread != NULL) {
+ if (wl->txq_thread) {
kthread_stop(wl->txq_thread);
wl->txq_thread = NULL;
}
}
tx_data = kmalloc(sizeof(struct tx_complete_data), GFP_ATOMIC);
- if (tx_data == NULL) {
+ if (!tx_data) {
PRINT_ER("Failed to allocate memory for tx_data structure\n");
dev_kfree_skb(skb);
netif_wake_queue(ndev);
nic = netdev_priv(ndev);
- if ((nic == NULL) || (nic->wilc_netdev == NULL) || (nic->wilc_netdev->ieee80211_ptr == NULL) || (nic->wilc_netdev->ieee80211_ptr->wiphy == NULL)) {
+ if (!nic || !nic->wilc_netdev || !nic->wilc_netdev->ieee80211_ptr ||
+ !nic->wilc_netdev->ieee80211_ptr->wiphy) {
PRINT_ER("nic = NULL\n");
return 0;
}
priv = wiphy_priv(nic->wilc_netdev->ieee80211_ptr->wiphy);
wl = nic->wilc;
- if (priv == NULL) {
+ if (!priv) {
PRINT_ER("priv = NULL\n");
return 0;
}
return 0;
}
- if (pstrWFIDrv == NULL) {
+ if (!pstrWFIDrv) {
PRINT_ER("pstrWFIDrv = NULL\n");
return 0;
}
return 0;
}
- if (nic->wilc_netdev != NULL) {
+ if (nic->wilc_netdev) {
/* Stop the network interface queue */
netif_stop_queue(nic->wilc_netdev);
perInterface_wlan_t *nic;
wilc_netdev = GetIfHandler(wilc, buff);
- if (wilc_netdev == NULL)
+ if (!wilc_netdev)
return;
buff += pkt_offset;
/* Need to send the packet up to the host, allocate a skb buffer */
skb = dev_alloc_skb(frame_len);
- if (skb == NULL) {
+ if (!skb) {
PRINT_ER("Low memory - packet droped\n");
return;
}
- if (wilc == NULL || wilc_netdev == NULL)
+ if (!wilc || !wilc_netdev)
PRINT_ER("wilc_netdev in wilc is NULL");
skb->dev = wilc_netdev;
- if (skb->dev == NULL)
+ if (!skb->dev)
PRINT_ER("skb->dev is NULL\n");
/*
SET_NETDEV_DEV(ndev, &local_sdio_func->dev);
#endif
- if (wdev == NULL) {
+ if (!wdev) {
PRINT_ER("Can't register WILC Wiphy\n");
return -1;
}