Commit cfcabdcc authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller
Browse files

[NET]: sparse warning fixes



Fix a bunch of sparse warnings. Mostly about 0 used as
NULL pointer, and shadowed variable declarations.
One notable case was that hash size should have been unsigned.

Signed-off-by: default avatarStephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent de83c058
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ struct inet_hashinfo {
	 */
	struct inet_bind_hashbucket	*bhash;

	int				bhash_size;
	unsigned int			bhash_size;
	unsigned int			ehash_size;

	/* All sockets in TCP_LISTEN state will be in here.  This is the only
+11 −11
Original line number Diff line number Diff line
@@ -486,15 +486,15 @@ static inline void sk_add_backlog(struct sock *sk, struct sk_buff *skb)
}

#define sk_wait_event(__sk, __timeo, __condition)			\
({	int rc;							\
	({	int __rc;						\
		release_sock(__sk);					\
	rc = __condition;					\
	if (!rc) {						\
		__rc = __condition;					\
		if (!__rc) {						\
			*(__timeo) = schedule_timeout(*(__timeo));	\
		}							\
		lock_sock(__sk);					\
	rc = __condition;					\
	rc;							\
		__rc = __condition;					\
		__rc;							\
	})

extern int sk_stream_wait_connect(struct sock *sk, long *timeo_p);
+0 −2
Original line number Diff line number Diff line
@@ -822,8 +822,6 @@ static int aarp_rcv(struct sk_buff *skb, struct net_device *dev,
				 * address. So as a precaution flush any
				 * entries we have for this address.
				 */
				struct aarp_entry *a;

				a = __aarp_find_entry(resolved[sa.s_node %
							  (AARP_HASH_SIZE - 1)],
						      skb->dev, &sa);
+1 −1
Original line number Diff line number Diff line
@@ -230,7 +230,7 @@ static void sigd_close(struct atm_vcc *vcc)
		struct hlist_head *head = &vcc_hash[i];

		sk_for_each(s, node, head) {
			struct atm_vcc *vcc = atm_sk(s);
			vcc = atm_sk(s);

			purge_vcc(vcc);
		}
+2 −2
Original line number Diff line number Diff line
@@ -780,7 +780,7 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
	int i = 0;
	const char *p;
	const int max_netdevices = 8*PAGE_SIZE;
	long *inuse;
	unsigned long *inuse;
	struct net_device *d;

	p = strnchr(name, IFNAMSIZ-1, '%');
@@ -794,7 +794,7 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
			return -EINVAL;

		/* Use one page as a bit array of possible slots */
		inuse = (long *) get_zeroed_page(GFP_ATOMIC);
		inuse = (unsigned long *) get_zeroed_page(GFP_ATOMIC);
		if (!inuse)
			return -ENOMEM;

Loading