SUPERH platform development
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: horms@verge.net.au, bhelgaas@google.com,
	linux-pci@vger.kernel.org, linux-sh@vger.kernel.org
Cc: phil.edworthy@renesas.com
Subject: [PATCH] pcie-rcar: kill duplicate checks
Date: Fri, 27 Jun 2014 14:59:13 +0000	[thread overview]
Message-ID: <201406271859.13626.sergei.shtylyov@cogentembedded.com> (raw)

The PCI core will have already checked the configuration register address before
calling the {read|write}() methods, no need to check it again in these methods.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against the 'next' branch of Bjorn Helgaas' 'pci.git' repo.

 drivers/pci/host/pcie-rcar.c |   10 ----------
 1 file changed, 10 deletions(-)

Index: pci/drivers/pci/host/pcie-rcar.c
=================================--- pci.orig/drivers/pci/host/pcie-rcar.c
+++ pci/drivers/pci/host/pcie-rcar.c
@@ -260,11 +260,6 @@ static int rcar_pcie_read_conf(struct pc
 	struct rcar_pcie *pcie = sys_to_pcie(bus->sysdata);
 	int ret;
 
-	if ((size = 2) && (where & 1))
-		return PCIBIOS_BAD_REGISTER_NUMBER;
-	else if ((size = 4) && (where & 3))
-		return PCIBIOS_BAD_REGISTER_NUMBER;
-
 	ret = rcar_pcie_config_access(pcie, PCI_ACCESS_READ,
 				      bus, devfn, where, val);
 	if (ret != PCIBIOS_SUCCESSFUL) {
@@ -291,11 +286,6 @@ static int rcar_pcie_write_conf(struct p
 	int shift, ret;
 	u32 data;
 
-	if ((size = 2) && (where & 1))
-		return PCIBIOS_BAD_REGISTER_NUMBER;
-	else if ((size = 4) && (where & 3))
-		return PCIBIOS_BAD_REGISTER_NUMBER;
-
 	ret = rcar_pcie_config_access(pcie, PCI_ACCESS_READ,
 				      bus, devfn, where, &data);
 	if (ret != PCIBIOS_SUCCESSFUL)

             reply	other threads:[~2014-06-27 14:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-27 14:59 Sergei Shtylyov [this message]
2014-06-27 16:31 ` [PATCH] pcie-rcar: kill duplicate checks Phil Edworthy
2014-06-28  0:06   ` Simon Horman
2014-07-05 17:47 ` 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=201406271859.13626.sergei.shtylyov@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=bhelgaas@google.com \
    --cc=horms@verge.net.au \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=phil.edworthy@renesas.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