spin_lock_irqsave(&wilc->txq_spinlock, flags);
- if (p->txq_head == NULL) {
+ if (!p->txq_head) {
tqe->next = NULL;
tqe->prev = NULL;
p->txq_head = tqe;
spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags);
- if (p->txq_head == NULL) {
+ if (!p->txq_head) {
tqe->next = NULL;
tqe->prev = NULL;
p->txq_head = tqe;
}
tqe = kmalloc(sizeof(struct txq_entry_t), GFP_ATOMIC);
- if (tqe == NULL) {
+ if (!tqe) {
PRINT_ER("Failed to allocate memory\n");
return 0;
}
tqe = kmalloc(sizeof(struct txq_entry_t), GFP_ATOMIC);
- if (tqe == NULL)
+ if (!tqe)
return 0;
tqe->type = WILC_NET_PKT;
tqe->buffer = buffer;
tqe = kmalloc(sizeof(struct txq_entry_t), GFP_KERNEL);
- if (tqe == NULL)
+ if (!tqe)
return 0;
tqe->type = WILC_MGMT_PKT;
tqe->buffer = buffer;
return 0;
mutex_lock(&wilc->rxq_cs);
- if (p->rxq_head == NULL) {
+ if (!p->rxq_head) {
PRINT_D(RX_DBG, "Add to Queue head\n");
rqe->next = NULL;
p->rxq_head = rqe;
i = 0;
sum = 0;
do {
- if ((tqe != NULL) && (i < (WILC_VMM_TBL_SIZE - 1))) {
+ if (tqe && (i < (WILC_VMM_TBL_SIZE - 1))) {
if (tqe->type == WILC_CFG_PKT)
vmm_sz = ETH_CONFIG_PKT_HDR_OFFSET;
i = 0;
do {
tqe = wilc_wlan_txq_remove_from_head(dev);
- if (tqe != NULL && (vmm_table[i] != 0)) {
+ if (tqe && (vmm_table[i] != 0)) {
u32 header, buffer_offset;
#ifdef BIG_ENDIAN
break;
}
rqe = wilc_wlan_rxq_remove(wilc);
- if (rqe == NULL) {
+ if (!rqe) {
PRINT_D(RX_DBG, "nothing in the queue - exit 1st do-while\n");
break;
}
#else
buffer = kmalloc(size, GFP_KERNEL);
- if (buffer == NULL) {
+ if (!buffer) {
wilc_debug(N_ERR, "[wilc isr]: fail alloc host memory...drop the packets (%d)\n", size);
usleep_range(100 * 1000, 100 * 1000);
goto _end_;
p->rx_buffer_offset = offset;
#endif
rqe = kmalloc(sizeof(struct rxq_entry_t), GFP_KERNEL);
- if (rqe != NULL) {
+ if (rqe) {
rqe->buffer = buffer;
rqe->buffer_size = size;
PRINT_D(RX_DBG, "rxq entery Size= %d - Address = %p\n", rqe->buffer_size, rqe->buffer);
blksz = BIT(12);
dma_buffer = kmalloc(blksz, GFP_KERNEL);
- if (dma_buffer == NULL) {
+ if (!dma_buffer) {
ret = -5;
PRINT_ER("Can't allocate buffer for firmware download IO error\n ");
goto _fail_1;
p->quit = 1;
do {
tqe = wilc_wlan_txq_remove_from_head(dev);
- if (tqe == NULL)
+ if (!tqe)
break;
if (tqe->tx_complete_func)
tqe->tx_complete_func(tqe->priv, 0);
do {
rqe = wilc_wlan_rxq_remove(wilc);
- if (rqe == NULL)
+ if (!rqe)
break;
#ifndef MEMORY_STATIC
kfree(rqe->buffer);
goto _fail_;
}
- if (g_wlan.tx_buffer == NULL)
+ if (!g_wlan.tx_buffer)
g_wlan.tx_buffer = kmalloc(LINUX_TX_SIZE, GFP_KERNEL);
PRINT_D(TX_DBG, "g_wlan.tx_buffer = %p\n", g_wlan.tx_buffer);
- if (g_wlan.tx_buffer == NULL) {
+ if (!g_wlan.tx_buffer) {
ret = -105;
PRINT_ER("Can't allocate Tx Buffer");
goto _fail_;
}
#if defined (MEMORY_STATIC)
- if (g_wlan.rx_buffer == NULL)
+ if (!g_wlan.rx_buffer)
g_wlan.rx_buffer = kmalloc(LINUX_RX_SIZE, GFP_KERNEL);
PRINT_D(TX_DBG, "g_wlan.rx_buffer =%p\n", g_wlan.rx_buffer);
- if (g_wlan.rx_buffer == NULL) {
+ if (!g_wlan.rx_buffer) {
ret = -105;
PRINT_ER("Can't allocate Rx Buffer");
goto _fail_;