public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI: remove type return
Date: Tue, 6 Aug 2024 18:11:36 +0300 (EEST)	[thread overview]
Message-ID: <a7f0433d-11ab-b404-31a6-944cf9637472@linux.intel.com> (raw)
In-Reply-To: <20240803140443.23036-1-trintaeoitogc@gmail.com>

On Sat, 3 Aug 2024, Guilherme Giacomo Simoes wrote:

> I can see that the function pci_hp_add_brigde have a int return propagation.

typo in function name. Add parenthesis after function names like this:
pci_hp_add_bridge()

> But in the drivers that pci_hp_add_bridge is called, your return never is
> cheked.

checked.

> This make me a think that the add bridge for pci hotplug drivers is not crucial
> for functionaly and your failed only should show a message in logs.

functionality

> 
> Then, I maked this patch for remove your return propagation for this moment.

Please write the commit message using imperative tone. Don't use "I", 
"me", "you", "your", or "we" at all.

Also, you need to signoff your patches (please read 
Documentation/process/submitting-patches.rst).

The lack of return value checking seems to be on the list in
pci_hp_add_bridge(). So perhaps the right course of action would be to 
handle return values correctly.

-- 
 i.

> ---
>  drivers/pci/pci.h   | 2 +-
>  drivers/pci/probe.c | 7 +++----
>  2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> index 79c8398f3938..a35dbfd89961 100644
> --- a/drivers/pci/pci.h
> +++ b/drivers/pci/pci.h
> @@ -189,7 +189,7 @@ static inline int pci_proc_detach_bus(struct pci_bus *bus) { return 0; }
>  #endif
>  
>  /* Functions for PCI Hotplug drivers to use */
> -int pci_hp_add_bridge(struct pci_dev *dev);
> +void pci_hp_add_bridge(struct pci_dev *dev);
>  
>  #if defined(CONFIG_SYSFS) && defined(HAVE_PCI_LEGACY)
>  void pci_create_legacy_files(struct pci_bus *bus);
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index b14b9876c030..b13c4c912eb1 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -3352,7 +3352,7 @@ void __init pci_sort_breadthfirst(void)
>  	bus_sort_breadthfirst(&pci_bus_type, &pci_sort_bf_cmp);
>  }
>  
> -int pci_hp_add_bridge(struct pci_dev *dev)
> +void pci_hp_add_bridge(struct pci_dev *dev)
>  {
>  	struct pci_bus *parent = dev->bus;
>  	int busnr, start = parent->busn_res.start;
> @@ -3365,7 +3365,7 @@ int pci_hp_add_bridge(struct pci_dev *dev)
>  	}
>  	if (busnr-- > end) {
>  		pci_err(dev, "No bus number available for hot-added bridge\n");
> -		return -1;
> +		return;
>  	}
>  
>  	/* Scan bridges that are already configured */
> @@ -3381,8 +3381,7 @@ int pci_hp_add_bridge(struct pci_dev *dev)
>  	pci_scan_bridge_extend(parent, dev, busnr, available_buses, 1);
>  
>  	if (!dev->subordinate)
> -		return -1;
> +		pci_err(dev, "No bus subordinate");
>  
> -	return 0;
>  }
>  EXPORT_SYMBOL_GPL(pci_hp_add_bridge);
> 

  reply	other threads:[~2024-08-06 15:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-03 14:04 [PATCH] PCI: remove type return Guilherme Giacomo Simoes
2024-08-06 15:11 ` Ilpo Järvinen [this message]
2024-08-06 20:54   ` Guilherme Giácomo Simões
2024-08-06 21:36     ` Bjorn Helgaas
2024-08-08 21:05       ` Guilherme Giácomo Simões
2024-08-09 12:44         ` Guilherme Giácomo Simões
2024-08-09 18:14         ` Bjorn Helgaas

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=a7f0433d-11ab-b404-31a6-944cf9637472@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=trintaeoitogc@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox