Commit e8a4e572 authored by Laura Garcia Liebana's avatar Laura Garcia Liebana Committed by Greg Kroah-Hartman

staging: octeon: Remove comparison to NULL

Comparison to NULL should be avoided in conditions. Chackpatch detected
these issues.
Signed-off-by: default avatarLaura Garcia Liebana <nevola@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0e350e17
...@@ -196,7 +196,7 @@ int cvm_oct_phy_setup_device(struct net_device *dev) ...@@ -196,7 +196,7 @@ int cvm_oct_phy_setup_device(struct net_device *dev)
priv->phydev = of_phy_connect(dev, phy_node, cvm_oct_adjust_link, 0, priv->phydev = of_phy_connect(dev, phy_node, cvm_oct_adjust_link, 0,
PHY_INTERFACE_MODE_GMII); PHY_INTERFACE_MODE_GMII);
if (priv->phydev == NULL) if (!priv->phydev)
return -ENODEV; return -ENODEV;
priv->last_link = 0; priv->last_link = 0;
......
...@@ -34,7 +34,7 @@ static int cvm_oct_fill_hw_skbuff(int pool, int size, int elements) ...@@ -34,7 +34,7 @@ static int cvm_oct_fill_hw_skbuff(int pool, int size, int elements)
while (freed) { while (freed) {
struct sk_buff *skb = dev_alloc_skb(size + 256); struct sk_buff *skb = dev_alloc_skb(size + 256);
if (unlikely(skb == NULL)) if (unlikely(!skb))
break; break;
skb_reserve(skb, 256 - (((unsigned long)skb->data) & 0x7f)); skb_reserve(skb, 256 - (((unsigned long)skb->data) & 0x7f));
*(struct sk_buff **)(skb->data - sizeof(void *)) = skb; *(struct sk_buff **)(skb->data - sizeof(void *)) = skb;
...@@ -98,7 +98,7 @@ static int cvm_oct_fill_hw_memory(int pool, int size, int elements) ...@@ -98,7 +98,7 @@ static int cvm_oct_fill_hw_memory(int pool, int size, int elements)
* just before the block. * just before the block.
*/ */
memory = kmalloc(size + 256, GFP_ATOMIC); memory = kmalloc(size + 256, GFP_ATOMIC);
if (unlikely(memory == NULL)) { if (unlikely(!memory)) {
pr_warn("Unable to allocate %u bytes for FPA pool %d\n", pr_warn("Unable to allocate %u bytes for FPA pool %d\n",
elements * size, pool); elements * size, pool);
break; break;
......
...@@ -209,7 +209,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget) ...@@ -209,7 +209,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
prefetch(work); prefetch(work);
did_work_request = 0; did_work_request = 0;
if (work == NULL) { if (!work) {
if (OCTEON_IS_MODEL(OCTEON_CN68XX)) { if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
cvmx_write_csr(CVMX_SSO_WQ_IQ_DIS, cvmx_write_csr(CVMX_SSO_WQ_IQ_DIS,
1ull << pow_receive_group); 1ull << pow_receive_group);
...@@ -416,7 +416,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget) ...@@ -416,7 +416,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
} }
cvm_oct_rx_refill_pool(0); cvm_oct_rx_refill_pool(0);
if (rx_count < budget && napi != NULL) { if (rx_count < budget && napi) {
/* No more work */ /* No more work */
napi_complete(napi); napi_complete(napi);
enable_irq(OCTEON_IRQ_WORKQ0 + pow_receive_group); enable_irq(OCTEON_IRQ_WORKQ0 + pow_receive_group);
...@@ -449,7 +449,7 @@ void cvm_oct_rx_initialize(void) ...@@ -449,7 +449,7 @@ void cvm_oct_rx_initialize(void)
} }
} }
if (NULL == dev_for_napi) if (!dev_for_napi)
panic("No net_devices were allocated."); panic("No net_devices were allocated.");
netif_napi_add(dev_for_napi, &cvm_oct_napi, cvm_oct_napi_poll, netif_napi_add(dev_for_napi, &cvm_oct_napi, cvm_oct_napi_poll,
......
...@@ -560,7 +560,7 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev) ...@@ -560,7 +560,7 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
/* Get a packet buffer */ /* Get a packet buffer */
packet_buffer = cvmx_fpa_alloc(CVMX_FPA_PACKET_POOL); packet_buffer = cvmx_fpa_alloc(CVMX_FPA_PACKET_POOL);
if (unlikely(packet_buffer == NULL)) { if (unlikely(!packet_buffer)) {
printk_ratelimited("%s: Failed to allocate a packet buffer\n", printk_ratelimited("%s: Failed to allocate a packet buffer\n",
dev->name); dev->name);
cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, 1); cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment