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

Commit 547b792c authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by David S. Miller
Browse files

net: convert BUG_TRAP to generic WARN_ON



Removes legacy reinvent-the-wheel type thing. The generic
machinery integrates much better to automated debugging aids
such as kerneloops.org (and others), and is unambiguous due to
better naming. Non-intuively BUG_TRAP() is actually equal to
WARN_ON() rather than BUG_ON() though some might actually be
promoted to BUG_ON() but I left that to future.

I could make at least one BUILD_BUG_ON conversion.

Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 53e5e96e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/bug.h>

#include <net/sock.h>

@@ -170,7 +171,7 @@ static inline struct request_sock *reqsk_queue_remove(struct request_sock_queue
{
	struct request_sock *req = queue->rskq_accept_head;

	BUG_TRAP(req != NULL);
	WARN_ON(req == NULL);

	queue->rskq_accept_head = req->dl_next;
	if (queue->rskq_accept_head == NULL)
@@ -185,7 +186,7 @@ static inline struct sock *reqsk_queue_get_child(struct request_sock_queue *queu
	struct request_sock *req = reqsk_queue_remove(queue);
	struct sock *child = req->sk;

	BUG_TRAP(child != NULL);
	WARN_ON(child == NULL);

	sk_acceptq_removed(parent);
	__reqsk_free(req);
+2 −2
Original line number Diff line number Diff line
@@ -959,7 +959,7 @@ static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset,
	for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
		int end;

		BUG_TRAP(start <= offset + len);
		WARN_ON(start > offset + len);

		end = start + skb_shinfo(skb)->frags[i].size;
		if ((copy = end - offset) > 0) {
@@ -986,7 +986,7 @@ static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset,
		for (; list; list = list->next) {
			int end;

			BUG_TRAP(start <= offset + len);
			WARN_ON(start > offset + len);

			end = start + list->len;
			if ((copy = end - offset) > 0) {
+4 −4
Original line number Diff line number Diff line
@@ -285,7 +285,7 @@ int skb_copy_datagram_iovec(const struct sk_buff *skb, int offset,
	for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
		int end;

		BUG_TRAP(start <= offset + len);
		WARN_ON(start > offset + len);

		end = start + skb_shinfo(skb)->frags[i].size;
		if ((copy = end - offset) > 0) {
@@ -315,7 +315,7 @@ int skb_copy_datagram_iovec(const struct sk_buff *skb, int offset,
		for (; list; list = list->next) {
			int end;

			BUG_TRAP(start <= offset + len);
			WARN_ON(start > offset + len);

			end = start + list->len;
			if ((copy = end - offset) > 0) {
@@ -366,7 +366,7 @@ static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset,
	for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
		int end;

		BUG_TRAP(start <= offset + len);
		WARN_ON(start > offset + len);

		end = start + skb_shinfo(skb)->frags[i].size;
		if ((copy = end - offset) > 0) {
@@ -402,7 +402,7 @@ static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset,
		for (; list; list=list->next) {
			int end;

			BUG_TRAP(start <= offset + len);
			WARN_ON(start > offset + len);

			end = start + list->len;
			if ((copy = end - offset) > 0) {
+5 −5
Original line number Diff line number Diff line
@@ -1973,7 +1973,7 @@ static void net_tx_action(struct softirq_action *h)
			struct sk_buff *skb = clist;
			clist = clist->next;

			BUG_TRAP(!atomic_read(&skb->users));
			WARN_ON(atomic_read(&skb->users));
			__kfree_skb(skb);
		}
	}
@@ -3847,7 +3847,7 @@ static void rollback_registered(struct net_device *dev)
		dev->uninit(dev);

	/* Notifier chain MUST detach us from master device. */
	BUG_TRAP(!dev->master);
	WARN_ON(dev->master);

	/* Remove entries from kobject tree */
	netdev_unregister_kobject(dev);
@@ -4169,9 +4169,9 @@ void netdev_run_todo(void)

		/* paranoia */
		BUG_ON(atomic_read(&dev->refcnt));
		BUG_TRAP(!dev->ip_ptr);
		BUG_TRAP(!dev->ip6_ptr);
		BUG_TRAP(!dev->dn_ptr);
		WARN_ON(dev->ip_ptr);
		WARN_ON(dev->ip6_ptr);
		WARN_ON(dev->dn_ptr);

		if (dev->destructor)
			dev->destructor(dev);
+1 −1
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ void reqsk_queue_destroy(struct request_sock_queue *queue)
		}
	}

	BUG_TRAP(lopt->qlen == 0);
	WARN_ON(lopt->qlen != 0);
	if (lopt_size > PAGE_SIZE)
		vfree(lopt);
	else
Loading