Commit d8101e7b authored by Joe Perches's avatar Joe Perches Committed by Michael Grzeschik

arcnet: Remove pointer comparisons to NULL

Use direct tests of pointer instead.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
parent 97464edd
...@@ -97,7 +97,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -97,7 +97,7 @@ static void rx(struct net_device *dev, int bufnum,
ofs = 256 - length; ofs = 256 - length;
skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
if (skb == NULL) { if (!skb) {
dev->stats.rx_dropped++; dev->stats.rx_dropped++;
return; return;
} }
......
...@@ -56,7 +56,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -56,7 +56,7 @@ static void rx(struct net_device *dev, int bufnum,
ofs = 256 - length; ofs = 256 - length;
skb = alloc_skb(length + ARC_HDR_SIZE + sizeof(int), GFP_ATOMIC); skb = alloc_skb(length + ARC_HDR_SIZE + sizeof(int), GFP_ATOMIC);
if (skb == NULL) { if (!skb) {
dev->stats.rx_dropped++; dev->stats.rx_dropped++;
return; return;
} }
...@@ -196,7 +196,7 @@ static int ack_tx(struct net_device *dev, int acked) ...@@ -196,7 +196,7 @@ static int ack_tx(struct net_device *dev, int acked)
/* Now alloc a skb to send back up through the layers: */ /* Now alloc a skb to send back up through the layers: */
ackskb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); ackskb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
if (ackskb == NULL) if (!ackskb)
goto free_outskb; goto free_outskb;
skb_put(ackskb, length + ARC_HDR_SIZE); skb_put(ackskb, length + ARC_HDR_SIZE);
......
...@@ -133,7 +133,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -133,7 +133,7 @@ static void rx(struct net_device *dev, int bufnum,
ofs = 256 - length; ofs = 256 - length;
skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
if (skb == NULL) { if (!skb) {
dev->stats.rx_dropped++; dev->stats.rx_dropped++;
return; return;
} }
......
...@@ -178,7 +178,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -178,7 +178,7 @@ static void rx(struct net_device *dev, int bufnum,
in->sequence = soft->sequence; in->sequence = soft->sequence;
skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
if (skb == NULL) { if (!skb) {
dev->stats.rx_dropped++; dev->stats.rx_dropped++;
return; return;
} }
...@@ -286,7 +286,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -286,7 +286,7 @@ static void rx(struct net_device *dev, int bufnum,
} }
in->skb = skb = alloc_skb(508 * in->numpackets + ARC_HDR_SIZE, in->skb = skb = alloc_skb(508 * in->numpackets + ARC_HDR_SIZE,
GFP_ATOMIC); GFP_ATOMIC);
if (skb == NULL) { if (!skb) {
arc_printk(D_NORMAL, dev, "(split) memory squeeze, dropping packet.\n"); arc_printk(D_NORMAL, dev, "(split) memory squeeze, dropping packet.\n");
lp->rfc1201.aborted_seq = soft->sequence; lp->rfc1201.aborted_seq = soft->sequence;
dev->stats.rx_dropped++; dev->stats.rx_dropped++;
......
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