All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Denis Efremov <efremov@linux.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	netdev@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/7] PCI/net: Use PCI_STD_NUM_BARS in loops instead of PCI_STD_RESOURCE_END
Date: Mon, 12 Aug 2019 15:02:08 -0500	[thread overview]
Message-ID: <20190812200208.GD11785@google.com> (raw)
In-Reply-To: <20190811150802.2418-5-efremov@linux.com>

The subject can be simply:

  <prefix>: Loop using PCI_STD_NUM_BARS

to keep them a little shorter so "git log --online" doesn't wrap.

On Sun, Aug 11, 2019 at 06:08:00PM +0300, Denis Efremov wrote:
> This patch refactors the loop condition scheme from
> 'i <= PCI_STD_RESOURCE_END' to 'i < PCI_STD_NUM_BARS'.

  Refactor loops to use 'i < PCI_STD_NUM_BARS' instead of 'i <=
  PCI_STD_RESOURCE_END'.

See https://chris.beams.io/posts/git-commit/

> Signed-off-by: Denis Efremov <efremov@linux.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 4 ++--
>  drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c   | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)

This patch touches two unrelated drivers and should be split up.
When you do that, pay attention to the convention for commit log
prefixes, e.g.,

  $ git log --oneline drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
  37e9c087c814 stmmac: pci: Fix typo in IOT2000 comment
  d4a62ea411f9 stmmac: pci: Use pci_dev_id() helper
  e0c1d14a1a32 stmmac: pci: Adjust IOT2000 matching

  $ git log --oneline drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c
  ea8c1c642ea5 net: dwc-xlgmac: declaration of dual license in headers
  65e0ace2c5cd net: dwc-xlgmac: Initial driver for DesignWare Enterprise Ethernet

> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> index 86f9c07a38cf..cfe496cdd78b 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
> @@ -258,7 +258,7 @@ static int stmmac_pci_probe(struct pci_dev *pdev,
>  	}
>  
>  	/* Get the base address of device */
> -	for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
> +	for (i = 0; i < PCI_STD_NUM_BARS; i++) {
>  		if (pci_resource_len(pdev, i) == 0)
>  			continue;
>  		ret = pcim_iomap_regions(pdev, BIT(i), pci_name(pdev));
> @@ -296,7 +296,7 @@ static void stmmac_pci_remove(struct pci_dev *pdev)
>  
>  	stmmac_dvr_remove(&pdev->dev);
>  
> -	for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
> +	for (i = 0; i < PCI_STD_NUM_BARS; i++) {
>  		if (pci_resource_len(pdev, i) == 0)
>  			continue;
>  		pcim_iounmap_regions(pdev, BIT(i));
> diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c b/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c
> index 386bafe74c3f..fa8604d7b797 100644
> --- a/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c
> +++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c
> @@ -34,7 +34,7 @@ static int xlgmac_probe(struct pci_dev *pcidev, const struct pci_device_id *id)
>  		return ret;
>  	}
>  
> -	for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
> +	for (i = 0; i < PCI_STD_NUM_BARS; i++) {
>  		if (pci_resource_len(pcidev, i) == 0)
>  			continue;
>  		ret = pcim_iomap_regions(pcidev, BIT(i), XLGMAC_DRV_NAME);
> -- 
> 2.21.0
> 

  reply	other threads:[~2019-08-12 20:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-11 15:07 [PATCH 0/7] Add definition for the number of standard PCI BARs Denis Efremov
2019-08-11 15:07 ` Denis Efremov
2019-08-11 15:07 ` [PATCH 1/7] PCI: Add define " Denis Efremov
2019-08-11 15:07   ` Denis Efremov
2019-08-11 15:07 ` [PATCH 2/7] s390/pci: Replace PCI_BAR_COUNT with PCI_STD_NUM_BARS Denis Efremov
2019-08-12 20:02   ` Bjorn Helgaas
2019-08-12 21:06     ` Denis Efremov
2019-08-11 15:07 ` [PATCH 3/7] x86/PCI: Use PCI_STD_NUM_BARS in loops instead of PCI_STD_RESOURCE_END Denis Efremov
2019-08-11 15:08 ` [PATCH 4/7] PCI/net: " Denis Efremov
2019-08-12 20:02   ` Bjorn Helgaas [this message]
2019-08-11 15:08 ` [PATCH 5/7] rapidio/tsi721: use " Denis Efremov
2019-08-11 15:08 ` [PATCH 6/7] efifb: Use " Denis Efremov
2019-08-11 15:08   ` Denis Efremov
2019-08-13 12:48   ` Bartlomiej Zolnierkiewicz
2019-08-13 12:48     ` Bartlomiej Zolnierkiewicz
2019-08-11 15:08 ` [PATCH 7/7] vfio_pci: " Denis Efremov
2019-08-12 20:02   ` Bjorn Helgaas
2019-08-12 20:52     ` Alex Williamson
2019-08-12  9:06 ` [PATCH 0/7] Add definition for the number of standard PCI BARs Andrew Murray
2019-08-12  9:06   ` Andrew Murray
2019-08-12 21:00   ` Denis Efremov
2019-08-12 21:00     ` Denis Efremov
2019-08-12 20:01 ` Bjorn Helgaas
2019-08-12 20:01   ` Bjorn Helgaas
2019-08-12 20:11   ` Thomas Gleixner
2019-08-12 20:11     ` Thomas Gleixner

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=20190812200208.GD11785@google.com \
    --to=helgaas@kernel.org \
    --cc=alexandre.torgue@st.com \
    --cc=efremov@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.