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

Commit 720a43ef authored by Joe Perches's avatar Joe Perches Committed by David S. Miller
Browse files

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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e8f83e5e
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -338,11 +338,8 @@ static void shm_rx_work_func(struct work_struct *rx_work)
			/* Get a suitable CAIF packet and copy in data. */
			skb = netdev_alloc_skb(pshm_drv->pshm_dev->pshm_netdev,
							frm_pck_len + 1);

			if (skb == NULL) {
				pr_info("OOM: Try next frame in descriptor\n");
			if (skb == NULL)
				break;
			}

			p = skb_put(skb, frm_pck_len);
			memcpy(p, pbuf->desc_vptr + frm_pck_ofs, frm_pck_len);
+2 −4
Original line number Diff line number Diff line
@@ -188,10 +188,9 @@ static int desc_list_init(struct net_device *dev)

		/* allocate a new skb for next time receive */
		new_skb = netdev_alloc_skb(dev, PKT_BUF_SZ + NET_IP_ALIGN);
		if (!new_skb) {
			pr_notice("init: low on mem - packet dropped\n");
		if (!new_skb)
			goto init_error;
		}

		skb_reserve(new_skb, NET_IP_ALIGN);
		/* Invidate the data cache of skb->data range when it is write back
		 * cache. It will prevent overwritting the new data from DMA
@@ -1236,7 +1235,6 @@ static void bfin_mac_rx(struct net_device *dev)

	new_skb = netdev_alloc_skb(dev, PKT_BUF_SZ + NET_IP_ALIGN);
	if (!new_skb) {
		netdev_notice(dev, "rx: low on mem - packet dropped\n");
		dev->stats.rx_dropped++;
		goto out;
	}
+0 −2
Original line number Diff line number Diff line
@@ -318,8 +318,6 @@ static int lance_rx (struct net_device *dev)
			struct sk_buff *skb = netdev_alloc_skb(dev, len + 2);

                        if (!skb) {
                                printk ("%s: Memory squeeze, deferring packet.\n",
                                        dev->name);
                                dev->stats.rx_dropped++;
                                rd->mblength = 0;
                                rd->rmd1_bits = LE_R1_OWN;
+0 −1
Original line number Diff line number Diff line
@@ -293,7 +293,6 @@ static int lance_rx(struct net_device *dev)
			struct sk_buff *skb = netdev_alloc_skb(dev, len + 2);

			if (!skb) {
				netdev_warn(dev, "Memory squeeze, deferring packet\n");
				dev->stats.rx_dropped++;
				rd->mblength = 0;
				rd->rmd1_bits = LE_R1_OWN;
+0 −1
Original line number Diff line number Diff line
@@ -528,7 +528,6 @@ am79c961_rx(struct net_device *dev, struct dev_priv *priv)
			dev->stats.rx_packets++;
		} else {
			am_writeword (dev, hdraddr + 2, RMD_OWN);
			printk (KERN_WARNING "%s: memory squeeze, dropping packet.\n", dev->name);
			dev->stats.rx_dropped++;
			break;
		}
Loading