aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorLaura Garcia Liebana <nevola@gmail.com>2016-02-28 00:43:12 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-11 22:09:09 -0800
commite8a4e572c4e75900c77a5854eb54a6c9173f9ac6 (patch)
tree01fac11b609d427aff236d01db1152ba97fd3a18 /drivers/staging
parentstaging: octeon: Insert blank line after struct declaration (diff)
downloadlinux-dev-e8a4e572c4e75900c77a5854eb54a6c9173f9ac6.tar.xz
linux-dev-e8a4e572c4e75900c77a5854eb54a6c9173f9ac6.zip
staging: octeon: Remove comparison to NULL
Comparison to NULL should be avoided in conditions. Chackpatch detected these issues. Signed-off-by: Laura Garcia Liebana <nevola@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/octeon/ethernet-mdio.c2
-rw-r--r--drivers/staging/octeon/ethernet-mem.c4
-rw-r--r--drivers/staging/octeon/ethernet-rx.c6
-rw-r--r--drivers/staging/octeon/ethernet-tx.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/octeon/ethernet-mdio.c b/drivers/staging/octeon/ethernet-mdio.c
index 0ac11b1221b7..e13a4ab46977 100644
--- a/drivers/staging/octeon/ethernet-mdio.c
+++ b/drivers/staging/octeon/ethernet-mdio.c
@@ -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,
PHY_INTERFACE_MODE_GMII);
- if (priv->phydev == NULL)
+ if (!priv->phydev)
return -ENODEV;
priv->last_link = 0;
diff --git a/drivers/staging/octeon/ethernet-mem.c b/drivers/staging/octeon/ethernet-mem.c
index 5a5cdb3cd740..d6172e4dace5 100644
--- a/drivers/staging/octeon/ethernet-mem.c
+++ b/drivers/staging/octeon/ethernet-mem.c
@@ -34,7 +34,7 @@ static int cvm_oct_fill_hw_skbuff(int pool, int size, int elements)
while (freed) {
struct sk_buff *skb = dev_alloc_skb(size + 256);
- if (unlikely(skb == NULL))
+ if (unlikely(!skb))
break;
skb_reserve(skb, 256 - (((unsigned long)skb->data) & 0x7f));
*(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)
* just before the block.
*/
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",
elements * size, pool);
break;
diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index ed553040cfb9..d82c67743ee5 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -209,7 +209,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
prefetch(work);
did_work_request = 0;
- if (work == NULL) {
+ if (!work) {
if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
cvmx_write_csr(CVMX_SSO_WQ_IQ_DIS,
1ull << pow_receive_group);
@@ -416,7 +416,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
}
cvm_oct_rx_refill_pool(0);
- if (rx_count < budget && napi != NULL) {
+ if (rx_count < budget && napi) {
/* No more work */
napi_complete(napi);
enable_irq(OCTEON_IRQ_WORKQ0 + pow_receive_group);
@@ -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.");
netif_napi_add(dev_for_napi, &cvm_oct_napi, cvm_oct_napi_poll,
diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index 94b0e673c00d..7c63b85504bb 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -560,7 +560,7 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
/* Get a packet buffer */
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",
dev->name);
cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, 1);