drivers:net: Remove unnecessary OOM messages after netdev_alloc_skb
Emitting netdev_alloc_skb and netdev_alloc_skb_ip_align OOM messages is unnecessary as there is already a dump_stack after allocation failures. Other trivial changes around these removals: Convert a few comparisons of pointer to 0 to !pointer. Change flow to remove unnecessary label. Remove now unused variable. Hoist assignment from if. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
e8f83e5ec7
commit
720a43efd3
@@ -1223,9 +1223,7 @@ static void smc_rcv(struct net_device *dev)
|
||||
dev->stats.multicast++;
|
||||
|
||||
skb = netdev_alloc_skb(dev, packet_length + 5);
|
||||
|
||||
if ( skb == NULL ) {
|
||||
printk(KERN_NOTICE CARDNAME ": Low memory, packet dropped.\n");
|
||||
dev->stats.rx_dropped++;
|
||||
goto done;
|
||||
}
|
||||
|
@@ -465,8 +465,6 @@ static inline void smc_rcv(struct net_device *dev)
|
||||
*/
|
||||
skb = netdev_alloc_skb(dev, packet_len);
|
||||
if (unlikely(skb == NULL)) {
|
||||
printk(KERN_NOTICE "%s: Low memory, packet dropped.\n",
|
||||
dev->name);
|
||||
SMC_WAIT_MMU_BUSY(lp);
|
||||
SMC_SET_MMU_CMD(lp, MC_RELEASE);
|
||||
dev->stats.rx_dropped++;
|
||||
|
@@ -848,10 +848,8 @@ static int smsc9420_alloc_rx_buffer(struct smsc9420_pdata *pd, int index)
|
||||
BUG_ON(pd->rx_buffers[index].skb);
|
||||
BUG_ON(pd->rx_buffers[index].mapping);
|
||||
|
||||
if (unlikely(!skb)) {
|
||||
smsc_warn(RX_ERR, "Failed to allocate new skb!");
|
||||
if (unlikely(!skb))
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
mapping = pci_map_single(pd->pdev, skb_tail_pointer(skb),
|
||||
PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
|
||||
|
Reference in New Issue
Block a user