Netdev List
 help / color / mirror / Atom feed
* [PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message
@ 2026-01-08  6:46 Kunihiko Hayashi
  2026-01-08  6:46 ` [PATCH net 2/2] net: ethernet: ave: Replace udelay with usleep_range Kunihiko Hayashi
  2026-01-08 18:32 ` [PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message Andrew Lunn
  0 siblings, 2 replies; 7+ messages in thread
From: Kunihiko Hayashi @ 2026-01-08  6:46 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: netdev, linux-kernel, Kunihiko Hayashi

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 2/2] net: ethernet: ave: Replace udelay with usleep_range
  2026-01-08  6:46 [PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message Kunihiko Hayashi
@ 2026-01-08  6:46 ` Kunihiko Hayashi
  2026-01-08  9:05   ` David Laight
  2026-01-08 18:32 ` [PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message Andrew Lunn
  1 sibling, 1 reply; 7+ messages in thread
From: Kunihiko Hayashi @ 2026-01-08  6:46 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: netdev, linux-kernel, Kunihiko Hayashi

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net 2/2] net: ethernet: ave: Replace udelay with usleep_range
  2026-01-08  6:46 ` [PATCH net 2/2] net: ethernet: ave: Replace udelay with usleep_range Kunihiko Hayashi
@ 2026-01-08  9:05   ` David Laight
  2026-01-09  0:59     ` Kunihiko Hayashi
  0 siblings, 1 reply; 7+ messages in thread
From: David Laight @ 2026-01-08  9:05 UTC (permalink / raw)
  To: Kunihiko Hayashi
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

On Thu,  8 Jan 2026 15:46:41 +0900
Kunihiko Hayashi <hayashi.kunihiko@socionext.com> wrote:

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

Nak.
Look at the code...

> 
>     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);


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message
  2026-01-08  6:46 [PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message Kunihiko Hayashi
  2026-01-08  6:46 ` [PATCH net 2/2] net: ethernet: ave: Replace udelay with usleep_range Kunihiko Hayashi
@ 2026-01-08 18:32 ` Andrew Lunn
  2026-01-09  0:27   ` Kunihiko Hayashi
  1 sibling, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2026-01-08 18:32 UTC (permalink / raw)
  To: Kunihiko Hayashi
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message
  2026-01-08 18:32 ` [PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message Andrew Lunn
@ 2026-01-09  0:27   ` Kunihiko Hayashi
  2026-01-09  1:20     ` Andrew Lunn
  0 siblings, 1 reply; 7+ messages in thread
From: Kunihiko Hayashi @ 2026-01-09  0:27 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

Hi Andrew,

On 2026/01/09 3:32, Andrew Lunn wrote:
> 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.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net 2/2] net: ethernet: ave: Replace udelay with usleep_range
  2026-01-08  9:05   ` David Laight
@ 2026-01-09  0:59     ` Kunihiko Hayashi
  0 siblings, 0 replies; 7+ messages in thread
From: Kunihiko Hayashi @ 2026-01-09  0:59 UTC (permalink / raw)
  To: David Laight
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

Hi David,

On 2026/01/08 18:05, David Laight wrote:
> On Thu,  8 Jan 2026 15:46:41 +0900
> Kunihiko Hayashi <hayashi.kunihiko@socionext.com> wrote:
> 
>> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message
  2026-01-09  0:27   ` Kunihiko Hayashi
@ 2026-01-09  1:20     ` Andrew Lunn
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Lunn @ 2026-01-09  1:20 UTC (permalink / raw)
  To: Kunihiko Hayashi
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

On Fri, Jan 09, 2026 at 09:27:03AM +0900, Kunihiko Hayashi wrote:
> Hi Andrew,
> 
> On 2026/01/09 3:32, Andrew Lunn wrote:
> > 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.
> 
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-01-09  1:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-08  6:46 [PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message Kunihiko Hayashi
2026-01-08  6:46 ` [PATCH net 2/2] net: ethernet: ave: Replace udelay with usleep_range Kunihiko Hayashi
2026-01-08  9:05   ` David Laight
2026-01-09  0:59     ` Kunihiko Hayashi
2026-01-08 18:32 ` [PATCH net 1/2] net: ethernet: ave: Remove unnecessary 'out of memory' message Andrew Lunn
2026-01-09  0:27   ` Kunihiko Hayashi
2026-01-09  1:20     ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox