linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Jingyu Wang <jingyuwang_vip@163.com>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pci: cleanup coding styling in pci-driver.c
Date: Tue, 6 Sep 2022 16:32:57 -0500	[thread overview]
Message-ID: <20220906213257.GA45793@bhelgaas> (raw)
In-Reply-To: <20220905140136.25066-1-jingyuwang_vip@163.com>

On Mon, Sep 05, 2022 at 10:01:36PM +0800, Jingyu Wang wrote:
> Signed-off-by: Jingyu Wang <jingyuwang_vip@163.com>

I'm not going to take this because:

  - Subject line doesn't follow drivers/pci capitalization convention.

  - Minor style changes by themselves aren't really worth it unless
    you are also doing more substantive improvements.

  - It contains a non-cosmetic return value change (ENOSYS/ENODEV)
    that is unrelated to the rest and not mentioned in the commit log.

> ---
>  drivers/pci/pci-driver.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
> index 49238ddd39ee..bba486f5e5fe 100644
> --- a/drivers/pci/pci-driver.c
> +++ b/drivers/pci/pci-driver.c
> @@ -204,6 +204,7 @@ static ssize_t new_id_store(struct device_driver *driver, const char *buf,
>  
>  	if (fields != 7) {
>  		struct pci_dev *pdev = kzalloc(sizeof(*pdev), GFP_KERNEL);
> +
>  		if (!pdev)
>  			return -ENOMEM;
>  
> @@ -222,8 +223,8 @@ static ssize_t new_id_store(struct device_driver *driver, const char *buf,
>  			return retval;
>  	}
>  
> -	/* Only accept driver_data values that match an existing id_table
> -	   entry */
> +	/* Only accept driver_data values that match an existing id_table entry
> +	 */
>  	if (ids) {
>  		retval = -EINVAL;
>  		while (ids->vendor || ids->subvendor || ids->class_mask) {
> @@ -272,6 +273,7 @@ static ssize_t remove_id_store(struct device_driver *driver, const char *buf,
>  	spin_lock(&pdrv->dynids.lock);
>  	list_for_each_entry_safe(dynid, n, &pdrv->dynids.list, node) {
>  		struct pci_device_id *id = &dynid->id;
> +
>  		if ((id->vendor == vendor) &&
>  		    (id->device == device) &&
>  		    (subvendor == PCI_ANY_ID || id->subvendor == subvendor) &&
> @@ -537,6 +539,7 @@ static int pci_restore_standard_config(struct pci_dev *pci_dev)
>  
>  	if (pci_dev->current_state != PCI_D0) {
>  		int error = pci_set_power_state(pci_dev, PCI_D0);
> +
>  		if (error)
>  			return error;
>  	}
> @@ -705,6 +708,7 @@ static int pci_pm_prepare(struct device *dev)
>  
>  	if (pm && pm->prepare) {
>  		int error = pm->prepare(dev);
> +
>  		if (error < 0)
>  			return error;
>  
> @@ -1364,7 +1368,7 @@ static int pci_pm_runtime_idle(struct device *dev)
>  		return 0;
>  
>  	if (!pm)
> -		return -ENOSYS;
> +		return -ENODEV;
>  
>  	if (pm->runtime_idle)
>  		return pm->runtime_idle(dev);
> @@ -1471,6 +1475,7 @@ struct pci_driver *pci_dev_driver(const struct pci_dev *dev)
>  		return dev->driver;
>  	else {
>  		int i;
> +
>  		for (i = 0; i <= PCI_ROM_RESOURCE; i++)
>  			if (dev->resource[i].flags & IORESOURCE_BUSY)
>  				return &pci_compat_driver;
> 
> base-commit: e47eb90a0a9ae20b82635b9b99a8d0979b757ad8
> -- 
> 2.34.1
> 

      reply	other threads:[~2022-09-06 21:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05 14:01 [PATCH] pci: cleanup coding styling in pci-driver.c Jingyu Wang
2022-09-06 21:32 ` Bjorn Helgaas [this message]

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=20220906213257.GA45793@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=jingyuwang_vip@163.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).