Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00db4124 authored by Ian Morris's avatar Ian Morris Committed by David S. Miller
Browse files

ipv4: coding style: comparison for inequality with NULL



The ipv4 code uses a mixture of coding styles. In some instances check
for non-NULL pointer is done as x != NULL and sometimes as x. x is
preferred according to checkpatch and this patch makes the code
consistent by adopting the latter form.

No changes detected by objdiff.

Signed-off-by: default avatarIan Morris <ipm@chirality.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 51456b29
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1269,7 +1269,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb,
		if (udpfrag) {
		if (udpfrag) {
			iph->id = htons(id);
			iph->id = htons(id);
			iph->frag_off = htons(offset >> 3);
			iph->frag_off = htons(offset >> 3);
			if (skb->next != NULL)
			if (skb->next)
				iph->frag_off |= htons(IP_MF);
				iph->frag_off |= htons(IP_MF);
			offset += skb->len - nhoff - ihl;
			offset += skb->len - nhoff - ihl;
		} else {
		} else {
+1 −1
Original line number Original line Diff line number Diff line
@@ -569,7 +569,7 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
		break;
		break;
#endif
#endif
	default:
	default:
		if (target_hw != NULL)
		if (target_hw)
			memcpy(arp_ptr, target_hw, dev->addr_len);
			memcpy(arp_ptr, target_hw, dev->addr_len);
		else
		else
			memset(arp_ptr, 0, dev->addr_len);
			memset(arp_ptr, 0, dev->addr_len);
+3 −3
Original line number Original line Diff line number Diff line
@@ -502,7 +502,7 @@ int cipso_v4_doi_add(struct cipso_v4_doi *doi_def,
	atomic_set(&doi_def->refcount, 1);
	atomic_set(&doi_def->refcount, 1);


	spin_lock(&cipso_v4_doi_list_lock);
	spin_lock(&cipso_v4_doi_list_lock);
	if (cipso_v4_doi_search(doi_def->doi) != NULL) {
	if (cipso_v4_doi_search(doi_def->doi)) {
		spin_unlock(&cipso_v4_doi_list_lock);
		spin_unlock(&cipso_v4_doi_list_lock);
		ret_val = -EEXIST;
		ret_val = -EEXIST;
		goto doi_add_return;
		goto doi_add_return;
@@ -513,7 +513,7 @@ int cipso_v4_doi_add(struct cipso_v4_doi *doi_def,


doi_add_return:
doi_add_return:
	audit_buf = netlbl_audit_start(AUDIT_MAC_CIPSOV4_ADD, audit_info);
	audit_buf = netlbl_audit_start(AUDIT_MAC_CIPSOV4_ADD, audit_info);
	if (audit_buf != NULL) {
	if (audit_buf) {
		const char *type_str;
		const char *type_str;
		switch (doi_type) {
		switch (doi_type) {
		case CIPSO_V4_MAP_TRANS:
		case CIPSO_V4_MAP_TRANS:
@@ -617,7 +617,7 @@ int cipso_v4_doi_remove(u32 doi, struct netlbl_audit *audit_info)


doi_remove_return:
doi_remove_return:
	audit_buf = netlbl_audit_start(AUDIT_MAC_CIPSOV4_DEL, audit_info);
	audit_buf = netlbl_audit_start(AUDIT_MAC_CIPSOV4_DEL, audit_info);
	if (audit_buf != NULL) {
	if (audit_buf) {
		audit_log_format(audit_buf,
		audit_log_format(audit_buf,
				 " cipso_doi=%u res=%u",
				 " cipso_doi=%u res=%u",
				 doi, ret_val == 0 ? 1 : 0);
				 doi, ret_val == 0 ? 1 : 0);
+1 −1
Original line number Original line Diff line number Diff line
@@ -1290,7 +1290,7 @@ __be32 inet_confirm_addr(struct net *net, struct in_device *in_dev,
	__be32 addr = 0;
	__be32 addr = 0;
	struct net_device *dev;
	struct net_device *dev;


	if (in_dev != NULL)
	if (in_dev)
		return confirm_addr_indev(in_dev, dst, local, scope);
		return confirm_addr_indev(in_dev, dst, local, scope);


	rcu_read_lock();
	rcu_read_lock();
+2 −2
Original line number Original line Diff line number Diff line
@@ -391,9 +391,9 @@ static void put_child(struct key_vector *tn, unsigned long i,
	BUG_ON(i >= child_length(tn));
	BUG_ON(i >= child_length(tn));


	/* update emptyChildren, overflow into fullChildren */
	/* update emptyChildren, overflow into fullChildren */
	if (!n && chi != NULL)
	if (!n && chi)
		empty_child_inc(tn);
		empty_child_inc(tn);
	if (n != NULL && !chi)
	if (n && !chi)
		empty_child_dec(tn);
		empty_child_dec(tn);


	/* update fullChildren */
	/* update fullChildren */
Loading