Thread (3 messages) flat view 3 messages, 3 authors, 2016-10-18

Re: [PATCH net-next 02/11] net: Introduce new api for walking upper and lower devices

From: David Miller <davem@davemloft.net>
Date: 2016-10-17 14:42:02
Also in: intel-wired-lan, linux-rdma

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon, 17 Oct 2016 05:21:21 -0700
You should write this more succinctly as:

static bool __netdev_has_upper_dev(struct net_device *upper_dev, void *data)
{
	struct net_device *dev = data;

	return upper_dev == dev;
}

bool netdev_has_upper_dev_all_rcu(struct net_device *dev,
				  struct net_device *upper_dev)
{
	return netdev_walk_all_upper_dev_rcu(dev,
			__netdev_has_upper_dev, upper_dev);
}

No if/else needed. No cast of void * ptr need. Use const if possible?
Agreed.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help