提交 d3b404c2 编写于 作者: H Heiner Kallweit 提交者: David S. Miller

r8169: simplify rtl8169_alloc_rx_data

dev->dev.parent has the same value as tp_to_dev(tp)
(set by SET_NETDEV_DEV() in rtl_init_one()) and we know it can't be NULL.
This allows us to simplify the code.
Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9a899a35
...@@ -6731,8 +6731,7 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp, ...@@ -6731,8 +6731,7 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
void *data; void *data;
dma_addr_t mapping; dma_addr_t mapping;
struct device *d = tp_to_dev(tp); struct device *d = tp_to_dev(tp);
struct net_device *dev = tp->dev; int node = dev_to_node(d);
int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
data = kmalloc_node(rx_buf_sz, GFP_KERNEL, node); data = kmalloc_node(rx_buf_sz, GFP_KERNEL, node);
if (!data) if (!data)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册