summaryrefslogtreecommitdiff
path: root/net/ipv4/ip_input.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-04-03 12:11:15 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-03 12:11:15 -0400
commit0bd66827220a7292bfbed54fb547c83363e07405 (patch)
tree627f419868eac50f1ae8582915827b2525fc5999 /net/ipv4/ip_input.c
parent11a9c7821c583aa22b35f37fba20539def9e8f14 (diff)
parent00db41243e8d5032c2e0f5bf6063bb19324bfdb3 (diff)
Merge branch 'ipv4-null-cmp'
Ian Morris says: ==================== ipv4: coding style - comparisons with NULL Per the suggestion of Joe Perches, attached is a patch which aligns the coding style in ipv4 for comparisons with NULL. The code uses multiple different styles when comparing with NULL (I.e. x == NULL and !x as well as x != NULL and x). Generally the latter form is preferred in netdev and so this changes aligns the code to this style. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_input.c')
-rw-r--r--net/ipv4/ip_input.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 3d4da2c16b6a..2e0410ed8f16 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -203,7 +203,7 @@ static int ip_local_deliver_finish(struct sk_buff *skb)
raw = raw_local_deliver(skb, protocol);
ipprot = rcu_dereference(inet_protos[protocol]);
- if (ipprot != NULL) {
+ if (ipprot) {
int ret;
if (!ipprot->no_policy) {
@@ -314,7 +314,7 @@ static int ip_rcv_finish(struct sk_buff *skb)
const struct iphdr *iph = ip_hdr(skb);
struct rtable *rt;
- if (sysctl_ip_early_demux && !skb_dst(skb) && skb->sk == NULL) {
+ if (sysctl_ip_early_demux && !skb_dst(skb) && !skb->sk) {
const struct net_protocol *ipprot;
int protocol = iph->protocol;
@@ -387,7 +387,8 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt,
IP_UPD_PO_STATS_BH(dev_net(dev), IPSTATS_MIB_IN, skb->len);
- if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (!skb) {
IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_INDISCARDS);
goto out;
}