[PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message

Subsystems: networking drivers, socionext (sni) ave network driver, the rest

STALE253d

7 messages, 3 authors, 2026-01-09 · open the first message on its own page

[PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message

From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Date: 2026-01-08 06:47:07

Follow the warning from checkpatch.pl and remove 'out of memory' message.

    WARNING: Possible unnecessary 'out of memory' message
    #590: FILE: drivers/net/ethernet/socionext/sni_ave.c:590:
    +               if (!skb) {
    +                       netdev_err(ndev, "can't allocate skb for Rx\n");

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/net/ethernet/socionext/sni_ave.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c
index 66b3549636f8..4700998c4837 100644
--- a/drivers/net/ethernet/socionext/sni_ave.c
+++ b/drivers/net/ethernet/socionext/sni_ave.c
@@ -586,10 +586,8 @@ static int ave_rxdesc_prepare(struct net_device *ndev, int entry)
 	skb = priv->rx.desc[entry].skbs;
 	if (!skb) {
 		skb = netdev_alloc_skb(ndev, AVE_MAX_ETHFRAME);
-		if (!skb) {
-			netdev_err(ndev, "can't allocate skb for Rx\n");
+		if (!skb)
 			return -ENOMEM;
-		}
 		skb->data += AVE_FRAME_HEADROOM;
 		skb->tail += AVE_FRAME_HEADROOM;
 	}
-- 
2.34.1

[PATCH net 2/2] net: ethernet: ave: Replace udelay with usleep_range

From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Date: 2026-01-08 06:47:14

Replace udelay() with usleep_range() as notified by checkpatch.pl.

    CHECK: usleep_range is preferred over udelay; see function description
    of usleep_range() and udelay().
    #906: FILE: drivers/net/ethernet/socionext/sni_ave.c:906:
    +       udelay(50);

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/net/ethernet/socionext/sni_ave.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c
index 4700998c4837..a3735d81a862 100644
--- a/drivers/net/ethernet/socionext/sni_ave.c
+++ b/drivers/net/ethernet/socionext/sni_ave.c
@@ -903,11 +903,11 @@ static void ave_rxfifo_reset(struct net_device *ndev)
 
 	/* assert reset */
 	writel(AVE_GRR_RXFFR, priv->base + AVE_GRR);
-	udelay(50);
+	usleep_range(50, 100);
 
 	/* negate reset */
 	writel(0, priv->base + AVE_GRR);
-	udelay(20);
+	usleep_range(20, 40);
 
 	/* negate interrupt status */
 	writel(AVE_GI_RXOVF, priv->base + AVE_GISR);
-- 
2.34.1

Re: [PATCH net 2/2] net: ethernet: ave: Replace udelay with usleep_range

From: David Laight <hidden>
Date: 2026-01-08 10:53:44

On Thu,  8 Jan 2026 15:46:41 +0900
Kunihiko Hayashi [off-list ref] wrote:
Replace udelay() with usleep_range() as notified by checkpatch.pl.
Nak.
Look at the code...
quoted hunk
    CHECK: usleep_range is preferred over udelay; see function description
    of usleep_range() and udelay().
    #906: FILE: drivers/net/ethernet/socionext/sni_ave.c:906:
    +       udelay(50);

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/net/ethernet/socionext/sni_ave.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c
index 4700998c4837..a3735d81a862 100644
--- a/drivers/net/ethernet/socionext/sni_ave.c
+++ b/drivers/net/ethernet/socionext/sni_ave.c
@@ -903,11 +903,11 @@ static void ave_rxfifo_reset(struct net_device *ndev)
 
 	/* assert reset */
 	writel(AVE_GRR_RXFFR, priv->base + AVE_GRR);
-	udelay(50);
+	usleep_range(50, 100);
 
 	/* negate reset */
 	writel(0, priv->base + AVE_GRR);
-	udelay(20);
+	usleep_range(20, 40);
 
 	/* negate interrupt status */
 	writel(AVE_GI_RXOVF, priv->base + AVE_GISR);

Re: [PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-01-08 18:33:01

On Thu, Jan 08, 2026 at 03:46:40PM +0900, Kunihiko Hayashi wrote:
Follow the warning from checkpatch.pl and remove 'out of memory' message.

    WARNING: Possible unnecessary 'out of memory' message
    #590: FILE: drivers/net/ethernet/socionext/sni_ave.c:590:
    +               if (!skb) {
    +                       netdev_err(ndev, "can't allocate skb for Rx\n");
Please take a read of

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html

You tagged this for net, not net-next. I would say this is not a fix.

    Andrew

---
pw-bot: cr

Re: [PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message

From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Date: 2026-01-09 00:27:03

Hi Andrew,

On 2026/01/09 3:32, Andrew Lunn wrote:
On Thu, Jan 08, 2026 at 03:46:40PM +0900, Kunihiko Hayashi wrote:
quoted
Follow the warning from checkpatch.pl and remove 'out of memory'
message.
quoted
     WARNING: Possible unnecessary 'out of memory' message
     #590: FILE: drivers/net/ethernet/socionext/sni_ave.c:590:
     +               if (!skb) {
     +                       netdev_err(ndev, "can't allocate skb for
Rx\n");

Please take a read of

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html

You tagged this for net, not net-next. I would say this is not a fix.
Thank you for pointing out.
I thought this was a "fix" for the warning, however, it's not a logical
fix. So I'll repost it as net-next.

Thank you,

---
Best Regards
Kunihiko Hayashi

Re: [PATCH net 2/2] net: ethernet: ave: Replace udelay with usleep_range

From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Date: 2026-01-09 00:59:45

Hi David,

On 2026/01/08 18:05, David Laight wrote:
On Thu,  8 Jan 2026 15:46:41 +0900
Kunihiko Hayashi [off-list ref] wrote:
quoted
Replace udelay() with usleep_range() as notified by checkpatch.pl.
Nak.
Look at the code...
Thank you for reviewing.

Indeed, since this function is called from an interrupt context,
it was not allowed to use usleep_range().

I'll keep udelay() here and close this patch.

Thank you,

---
Best Regards
Kunihiko Hayashi

Re: [PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-01-09 01:20:14

On Fri, Jan 09, 2026 at 09:27:03AM +0900, Kunihiko Hayashi wrote:
Hi Andrew,

On 2026/01/09 3:32, Andrew Lunn wrote:
quoted
On Thu, Jan 08, 2026 at 03:46:40PM +0900, Kunihiko Hayashi wrote:
quoted
Follow the warning from checkpatch.pl and remove 'out of memory'
message.
quoted
     WARNING: Possible unnecessary 'out of memory' message
     #590: FILE: drivers/net/ethernet/socionext/sni_ave.c:590:
     +               if (!skb) {
     +                       netdev_err(ndev, "can't allocate skb for
Rx\n");

Please take a read of

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html

You tagged this for net, not net-next. I would say this is not a fix.
Thank you for pointing out.
I thought this was a "fix" for the warning, however, it's not a logical
fix. So I'll repost it as net-next.
You might want to read:

https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

One key thing in that document is:

   It must either fix a real bug that bothers people or just add a device ID

Multiple messages that the system is out of people does not bother
people.

	Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help