mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Stanner <pstanner@redhat.com>
To: Yanteng Si <si.yanteng@linux.dev>,
	Philipp Stanner <phasta@kernel.org>,
	 Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Huacai Chen <chenhuacai@kernel.org>,
	Yinggang Gu <guyinggang@loongson.cn>,
	Feiyang Chen <chenfeiyang@loongson.cn>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Qing Zhang <zhangqing@loongson.cn>
Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	 linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 2/4] stmmac: loongson: Remove surplus loop
Date: Tue, 25 Feb 2025 10:15:03 +0100	[thread overview]
Message-ID: <7df6e1846ed6932c789a913c6a10aa8df5e26519.camel@redhat.com> (raw)
In-Reply-To: <437d4fad-6cd4-4f90-a1bb-07193d015cad@linux.dev>

On Tue, 2025-02-25 at 17:06 +0800, Yanteng Si wrote:
> 
> 在 2/24/25 9:53 PM, Philipp Stanner 写道:
> > loongson_dwmac_probe() contains a loop which doesn't have an
> > effect,
> > because it tries to call pcim_iomap_regions() with the same
> > parameters
> > several times. The break statement at the loop's end furthermore
> > ensures
> > that the loop only runs once anyways.
> > 
> > Remove the surplus loop.
> > 
> > Signed-off-by: Philipp Stanner <phasta@kernel.org>
> 
> It seems that the fix-tag has been forgotten, next two patches as
> well.

Not forgotten, I just think that patches 2-4 are code improvements, not
bug fixes.

The issue in patch 1 would cause actual misbehavior (a useless debug
information print in case of a resource collision), whereas 2-4 are
just ugly code, but not actual bugs: the loop always just runs once;
and unmapping the PCI resources manually is valid, but obviously
unnecessary.

Agreed?

P.

> 
> 
> Reviewed-by: Yanteng Si <si.yanteng@linux.dev>
> 
> Thanks,
> Yanteng
> 
> > ---
> >   drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 11 +++----
> > ----
> >   1 file changed, 3 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> > b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> > index 73a6715a93e6..e3cacd085b3f 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> > @@ -554,14 +554,9 @@ static int loongson_dwmac_probe(struct pci_dev
> > *pdev, const struct pci_device_id
> >   	pci_set_master(pdev);
> >   
> >   	/* Get the base address of device */
> > -	for (i = 0; i < PCI_STD_NUM_BARS; i++) {
> > -		if (pci_resource_len(pdev, i) == 0)
> > -			continue;
> > -		ret = pcim_iomap_regions(pdev, BIT(0),
> > DRIVER_NAME);
> > -		if (ret)
> > -			goto err_disable_device;
> > -		break;
> > -	}
> > +	ret = pcim_iomap_regions(pdev, BIT(0), DRIVER_NAME);
> > +	if (ret)
> > +		goto err_disable_device;
> >   
> >   	memset(&res, 0, sizeof(res));
> >   	res.addr = pcim_iomap_table(pdev)[0];


  reply	other threads:[~2025-02-25  9:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24 13:53 [PATCH net-next v3 0/4] stmmac: Several PCI-related improvements Philipp Stanner
2025-02-24 13:53 ` [PATCH net-next v3 1/4] stmmac: loongson: Pass correct arg to PCI function Philipp Stanner
2025-02-24 19:55   ` Andrew Lunn
2025-02-25  9:00   ` Yanteng Si
2025-02-24 13:53 ` [PATCH net-next v3 2/4] stmmac: loongson: Remove surplus loop Philipp Stanner
2025-02-24 19:55   ` Andrew Lunn
2025-02-25  9:06   ` Yanteng Si
2025-02-25  9:15     ` Philipp Stanner [this message]
2025-02-26  1:57       ` Yanteng Si
2025-02-25  9:29   ` Huacai Chen
2025-02-24 13:53 ` [PATCH net-next v3 3/4] stmmac: Remove pcim_* functions for driver detach Philipp Stanner
2025-02-24 19:56   ` Andrew Lunn
2025-02-25  9:10   ` Yanteng Si
2025-02-25  9:19     ` Huacai Chen
2025-02-24 13:53 ` [PATCH net-next v3 4/4] stmmac: Replace deprecated PCI functions Philipp Stanner
2025-02-24 19:57   ` Andrew Lunn
2025-02-25  7:16   ` Philipp Stanner
2025-02-25  9:14     ` Yanteng Si
2025-02-25  9:30   ` Huacai Chen
2025-02-25  8:42 ` [PATCH net-next v3 0/4] stmmac: Several PCI-related improvements Henry Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7df6e1846ed6932c789a913c6a10aa8df5e26519.camel@redhat.com \
    --to=pstanner@redhat.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=chenfeiyang@loongson.cn \
    --cc=chenhuacai@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=guyinggang@loongson.cn \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=phasta@kernel.org \
    --cc=si.yanteng@linux.dev \
    --cc=zhangqing@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®