mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Alex_Gagniuc@Dellteam.com>
To: <keith.busch@intel.com>, <mr.nuke.me@gmail.com>
Cc: <bhelgaas@google.com>, <Austin.Bolen@dell.com>,
	<Shyam.Iyer@dell.com>, <linux-pci@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PCI: access.c: Piggyback user config access on pci_read/write_*()
Date: Mon, 4 Jun 2018 16:14:36 +0000	[thread overview]
Message-ID: <02be2689d0b44afdb449b4dc17415b8f@ausx13mps321.AMER.DELL.COM> (raw)
In-Reply-To: <20180604161213.GA7712@localhost.localdomain>

On 6/4/2018 11:09 AM, Keith Busch wrote:
> On Mon, Jun 04, 2018 at 10:48:02AM -0500, Alexandru Gagniuc wrote:
>> +++ b/drivers/pci/access.c
>> @@ -223,16 +223,9 @@ int pci_user_read_config_##size						\
>>   	(struct pci_dev *dev, int pos, type *val)			\
>>   {									\
>>   	int ret = PCIBIOS_SUCCESSFUL;					\
>> -	u32 data = -1;							\
>>   	if (PCI_##size##_BAD)						\
>>   		return -EINVAL;						\
>> -	raw_spin_lock_irq(&pci_lock);				\
>> -	if (unlikely(dev->block_cfg_access))				\
>> -		pci_wait_cfg(dev);					\
>> -	ret = dev->bus->ops->read(dev->bus, dev->devfn,			\
>> -					pos, sizeof(type), &data);	\
>> -	raw_spin_unlock_irq(&pci_lock);				\
>> -	*val = (type)data;						\
>> +	ret = pci_read_config_##size(dev, pos, val);			\
>>   	return pcibios_err_to_errno(ret);				\
>>   }									\
> 
> If it wasn't for the block_cfg_access check for user access, this would
> have been a nice code reuse cleanup.

Great fresh catch! I'll get that fixed in v2.

Alex


      reply	other threads:[~2018-06-04 16:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-04 15:48 Alexandru Gagniuc
2018-06-04 16:12 ` Keith Busch
2018-06-04 16:14   ` Alex_Gagniuc [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=02be2689d0b44afdb449b4dc17415b8f@ausx13mps321.AMER.DELL.COM \
    --to=alex_gagniuc@dellteam.com \
    --cc=Austin.Bolen@dell.com \
    --cc=Shyam.Iyer@dell.com \
    --cc=bhelgaas@google.com \
    --cc=keith.busch@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mr.nuke.me@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

all inboxes | Powered by JetHome®