All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saheed Olayemi Bolarinwa <refactormyself@gmail.com>
To: helgaas@kernel.org
Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>,
	linuxppc-dev@lists.ozlabs.org, Arnd Bergmann <arnd@arndb.de>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Sam Bobroff <sbobroff@linux.ibm.com>,
	Bolarinwa Olayemi Saheed <refactormyself@gmail.com>,
	Dennis Dalessandro <dennis.dalessandro@intel.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-kernel@vger.kernel.org,
	Len Brown Lukas Wunner <"lenb@kernel.orglukas"@wunner.de>,
	linux-acpi@vger.kernel.org, Doug Ledford <dledford@redhat.com>,
	Russell Currey <ruscur@russell.cc>,
	linux-pci@vger.kernel.org, Oliver O'Halloran <oohall@gmail.com>,
	linux-kernel-mentees@lists.linuxfoundation.org,
	linux-rdma@vger.kernel.org
Subject: [Linux-kernel-mentees] [PATCH 11/11 RFC] PCI: Remove "*val = 0" from pcie_capability_read_*()
Date: Mon,  6 Jul 2020 11:31:21 +0200	[thread overview]
Message-ID: <20200706093121.9731-12-refactormyself@gmail.com> (raw)
In-Reply-To: <20200706093121.9731-1-refactormyself@gmail.com>

From: Bolarinwa Olayemi Saheed <refactormyself@gmail.com>

 **TODO**

Suggested-by: Bjorn Helgaas <bjorn@helgaas.com>
Signed-off-by: Bolarinwa Olayemi Saheed <refactormyself@gmail.com>
---
This patch  depends on all of the preceeding patches in this series,
otherwise it will introduce bugs as pointed out in the commit message
of each.
 drivers/pci/access.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/pci/access.c b/drivers/pci/access.c
index 79c4a2ef269a..ec95edbb1ac8 100644
--- a/drivers/pci/access.c
+++ b/drivers/pci/access.c
@@ -413,13 +413,6 @@ int pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val)
 
 	if (pcie_capability_reg_implemented(dev, pos)) {
 		ret = pci_read_config_word(dev, pci_pcie_cap(dev) + pos, val);
-		/*
-		 * Reset *val to 0 if pci_read_config_word() fails, it may
-		 * have been written as 0xFFFF if hardware error happens
-		 * during pci_read_config_word().
-		 */
-		if (ret)
-			*val = 0;
 		return ret;
 	}
 
@@ -448,13 +441,6 @@ int pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *val)
 
 	if (pcie_capability_reg_implemented(dev, pos)) {
 		ret = pci_read_config_dword(dev, pci_pcie_cap(dev) + pos, val);
-		/*
-		 * Reset *val to 0 if pci_read_config_dword() fails, it may
-		 * have been written as 0xFFFFFFFF if hardware error happens
-		 * during pci_read_config_dword().
-		 */
-		if (ret)
-			*val = 0;
 		return ret;
 	}
 
-- 
2.18.2

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

WARNING: multiple messages have this Message-ID (diff)
From: Saheed Olayemi Bolarinwa <refactormyself@gmail.com>
To: helgaas@kernel.org
Cc: , Mike Marciniszyn <mike.marciniszyn@intel.com>,
	linuxppc-dev@lists.ozlabs.org,
	"Greg Kroah-Hartman linux-rdma @ vger . kernel . org"
	<gregkh@linuxfoundation.org>, Arnd Bergmann <arnd@arndb.de>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Sam Bobroff <sbobroff@linux.ibm.com>,
	Bolarinwa Olayemi Saheed <refactormyself@gmail.com>,
	Dennis Dalessandro <dennis.dalessandro@intel.com>,
	skhan@linuxfoundation.org,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-kernel@vger.kernel.org, wunner.de@lists.ozlabs.org,
	linux-acpi@vger.kernel.org, Doug Ledford <dledford@redhat.com>,
	linux-pci@vger.kernel.org, bjorn@helgaas.com,
	Oliver O'Halloran <oohall@gmail.com>,
	linux-kernel-mentees@lists.linuxfoundation.org,
	linux-rdma@vger.kernel.org
Subject: [PATCH 11/11 RFC] PCI: Remove "*val = 0" from pcie_capability_read_*()
Date: Mon,  6 Jul 2020 11:31:21 +0200	[thread overview]
Message-ID: <20200706093121.9731-12-refactormyself@gmail.com> (raw)
In-Reply-To: <20200706093121.9731-1-refactormyself@gmail.com>

From: Bolarinwa Olayemi Saheed <refactormyself@gmail.com>

 **TODO**

Suggested-by: Bjorn Helgaas <bjorn@helgaas.com>
Signed-off-by: Bolarinwa Olayemi Saheed <refactormyself@gmail.com>
---
This patch  depends on all of the preceeding patches in this series,
otherwise it will introduce bugs as pointed out in the commit message
of each.
 drivers/pci/access.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/pci/access.c b/drivers/pci/access.c
index 79c4a2ef269a..ec95edbb1ac8 100644
--- a/drivers/pci/access.c
+++ b/drivers/pci/access.c
@@ -413,13 +413,6 @@ int pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val)
 
 	if (pcie_capability_reg_implemented(dev, pos)) {
 		ret = pci_read_config_word(dev, pci_pcie_cap(dev) + pos, val);
-		/*
-		 * Reset *val to 0 if pci_read_config_word() fails, it may
-		 * have been written as 0xFFFF if hardware error happens
-		 * during pci_read_config_word().
-		 */
-		if (ret)
-			*val = 0;
 		return ret;
 	}
 
@@ -448,13 +441,6 @@ int pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *val)
 
 	if (pcie_capability_reg_implemented(dev, pos)) {
 		ret = pci_read_config_dword(dev, pci_pcie_cap(dev) + pos, val);
-		/*
-		 * Reset *val to 0 if pci_read_config_dword() fails, it may
-		 * have been written as 0xFFFFFFFF if hardware error happens
-		 * during pci_read_config_dword().
-		 */
-		if (ret)
-			*val = 0;
 		return ret;
 	}
 
-- 
2.18.2


  parent reply	other threads:[~2020-07-06 10:32 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06  9:31 [Linux-kernel-mentees] [PATCH 0/11 RFC] PCI: Remove "*val = 0" from pcie_capability_read_*() Saheed Olayemi Bolarinwa
2020-07-06  9:31 ` Saheed Olayemi Bolarinwa
2020-07-06  9:31 ` [Linux-kernel-mentees] [PATCH 2/11 RFC] misc: rtsx: Confirm that pcie_capability_read_word() is successful Saheed Olayemi Bolarinwa
2020-07-06  9:31   ` Saheed Olayemi Bolarinwa
2020-07-06  9:31 ` [Linux-kernel-mentees] [PATCH 3/11 RFC] PCI: pciehp: Validate with the return value of pcie_capability_read_*() Saheed Olayemi Bolarinwa
2020-07-06  9:31   ` Saheed Olayemi Bolarinwa
2020-07-06  9:31 ` [Linux-kernel-mentees] [PATCH 4/11 " Saheed Olayemi Bolarinwa
2020-07-06  9:31   ` Saheed Olayemi Bolarinwa
2020-07-06  9:31 ` [Linux-kernel-mentees] [PATCH 5/11 RFC] PCI: pciehp: Make "Power On" the default Saheed Olayemi Bolarinwa
2020-07-06  9:31   ` Saheed Olayemi Bolarinwa
2020-07-10  0:14   ` [Linux-kernel-mentees] " Bjorn Helgaas
2020-07-10  0:14     ` Bjorn Helgaas
2020-07-10 21:42     ` [Linux-kernel-mentees] " Saheed Bolarinwa
2020-07-10 21:42       ` Saheed Bolarinwa
2020-07-06  9:31 ` [Linux-kernel-mentees] [PATCH 7/11 RFC] PCI: Validate with the return value of pcie_capability_read_*() Saheed Olayemi Bolarinwa
2020-07-06  9:31   ` Saheed Olayemi Bolarinwa
2020-07-06  9:31 ` [Linux-kernel-mentees] [PATCH 8/11 RFC] PCI/PM: Use error return value from pcie_capability_read_*() Saheed Olayemi Bolarinwa
2020-07-06  9:31   ` Saheed Olayemi Bolarinwa
2020-07-06  9:31 ` [Linux-kernel-mentees] [PATCH 10/11 RFC] PCI/ASPM: " Saheed Olayemi Bolarinwa
2020-07-06  9:31   ` Saheed Olayemi Bolarinwa
2020-07-06  9:31 ` Saheed Olayemi Bolarinwa [this message]
2020-07-06  9:31   ` [PATCH 11/11 RFC] PCI: Remove "*val = 0" " Saheed Olayemi Bolarinwa
2020-07-10  0:11 ` [PATCH 0/11 " Bjorn Helgaas
2020-07-10 21:32   ` Saheed Bolarinwa

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=20200706093121.9731-12-refactormyself@gmail.com \
    --to=refactormyself@gmail.com \
    --cc="lenb@kernel.orglukas"@wunner.de \
    --cc=arnd@arndb.de \
    --cc=dennis.dalessandro@intel.com \
    --cc=dledford@redhat.com \
    --cc=helgaas@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mike.marciniszyn@intel.com \
    --cc=oohall@gmail.com \
    --cc=rjw@rjwysocki.net \
    --cc=ruscur@russell.cc \
    --cc=sbobroff@linux.ibm.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.