Linux-Amlogic Archive on lore.kernel.org
 help / color / Atom feed
From: Gustavo Pimentel <Gustavo.Pimentel@synopsys.com>
To: "Saheed O. Bolarinwa" <refactormyself@gmail.com>,
	"helgaas@kernel.org" <helgaas@kernel.org>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Rob Herring <robh@kernel.org>,
	Ley Foon Tan <ley.foon.tan@intel.com>,
	Marek Vasut <marek.vasut+renesas@gmail.com>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	"bcm-kernel-feedback-list@broadcom.com"
	<bcm-kernel-feedback-list@broadcom.com>,
	Toan Le <toan@os.amperecomputing.com>,
	Jingoo Han <jingoohan1@gmail.com>,
	Yue Wang <yue.wang@Amlogic.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Philipp Zabel <p.zabel@pengutronix.de>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"rfi@lists.rocketboards.org" <rfi@lists.rocketboards.org>,
	"linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>,
	"skhan@linuxfoundation.org" <skhan@linuxfoundation.org>,
	"bjorn@helgaas.com" <bjorn@helgaas.com>,
	"linux-amlogic@lists.infradead.org"
	<linux-amlogic@lists.infradead.org>,
	"linux-kernel-mentees@lists.linuxfoundation.org"
	<linux-kernel-mentees@lists.linuxfoundation.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [RFC PATCH 06/35] PCI: Tidy Success/Failure checks
Date: Mon, 13 Jul 2020 13:59:28 +0000
Message-ID: <DM5PR12MB12762A48A839874F3CC59AEEDA600@DM5PR12MB1276.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20200713122247.10985-7-refactormyself@gmail.com>

On Mon, Jul 13, 2020 at 13:22:18, Saheed O. Bolarinwa 
<refactormyself@gmail.com> wrote:

> Remove unnecessary check for 0.
> 
> Signed-off-by: "Saheed O. Bolarinwa" <refactormyself@gmail.com>
> ---
> This patch depends on PATCH 05/35
> 
>  drivers/pci/controller/dwc/pci-meson.c            | 2 +-
>  drivers/pci/controller/dwc/pcie-designware-host.c | 2 +-
>  drivers/pci/controller/pci-xgene.c                | 3 +--
>  drivers/pci/controller/pcie-altera.c              | 4 ++--
>  drivers/pci/controller/pcie-iproc.c               | 2 +-
>  drivers/pci/controller/pcie-rcar-host.c           | 4 ++--
>  6 files changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
> index 58142f03d300..8203d5f95d28 100644
> --- a/drivers/pci/controller/dwc/pci-meson.c
> +++ b/drivers/pci/controller/dwc/pci-meson.c
> @@ -390,7 +390,7 @@ static int meson_pcie_rd_own_conf(struct pcie_port *pp, int where, int size,
>  	int ret;
>  
>  	ret = dw_pcie_read(pci->dbi_base + where, size, val);
> -	if (ret != 0)
> +	if (ret)
>  		return ret;
>  
>  	/*
> diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
> index 7c97c54f787c..2dd3965365f6 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-host.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
> @@ -459,7 +459,7 @@ int dw_pcie_host_init(struct pcie_port *pp)
>  	}
>  
>  	ret = dw_pcie_rd_own_conf(pp, PCI_HEADER_TYPE, 1, &hdr_type);
> -	if (ret != 0) {
> +	if (ret) {
>  		dev_err(pci->dev, "Failed reading PCI_HEADER_TYPE cfg space reg (ret: 0x%x)\n",
>  			ret);
>  		ret = pcibios_err_to_errno(ret);
> diff --git a/drivers/pci/controller/pci-xgene.c b/drivers/pci/controller/pci-xgene.c
> index bf74f0a8b451..8d55cfc4ff8a 100644
> --- a/drivers/pci/controller/pci-xgene.c
> +++ b/drivers/pci/controller/pci-xgene.c
> @@ -167,8 +167,7 @@ static int xgene_pcie_config_read32(struct pci_bus *bus, unsigned int devfn,
>  {
>  	struct xgene_pcie_port *port = pcie_bus_to_port(bus);
>  
> -	if (pci_generic_config_read32(bus, devfn, where & ~0x3, 4, val) !=
> -	    0)
> +	if (pci_generic_config_read32(bus, devfn, where & ~0x3, 4, val))
>  		return PCIBIOS_DEVICE_NOT_FOUND;
>  
>  	/*
> diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c
> index 96f5bda32b58..9f7b12ad0c04 100644
> --- a/drivers/pci/controller/pcie-altera.c
> +++ b/drivers/pci/controller/pcie-altera.c
> @@ -367,7 +367,7 @@ static int tlp_cfg_dword_write(struct altera_pcie *pcie, u8 bus, u32 devfn,
>  						    value, false);
>  
>  	ret = pcie->pcie_data->ops->tlp_read_pkt(pcie, NULL);
> -	if (ret != 0)
> +	if (ret)
>  		return ret;
>  
>  	/*
> @@ -453,7 +453,7 @@ static int _altera_pcie_cfg_read(struct altera_pcie *pcie, u8 busno,
>  
>  	ret = tlp_cfg_dword_read(pcie, busno, devfn,
>  				 (where & ~DWORD_MASK), byte_en, &data);
> -	if (ret != 0)
> +	if (ret)
>  		return ret;
>  
>  	switch (size) {
> diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c
> index dac9352c0cb2..d34c9457fbe4 100644
> --- a/drivers/pci/controller/pcie-iproc.c
> +++ b/drivers/pci/controller/pcie-iproc.c
> @@ -584,7 +584,7 @@ static int iproc_pcie_config_read(struct pci_bus *bus, unsigned int devfn,
>  	/* root complex access */
>  	if (busno == 0) {
>  		ret = pci_generic_config_read32(bus, devfn, where, size, val);
> -		if (ret == 0)
> +		if (!ret)
>  			iproc_pcie_fix_cap(pcie, where, val);
>  
>  		return ret;
> diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c
> index 363a8630de28..2bb250c6f767 100644
> --- a/drivers/pci/controller/pcie-rcar-host.c
> +++ b/drivers/pci/controller/pcie-rcar-host.c
> @@ -157,7 +157,7 @@ static int rcar_pcie_read_conf(struct pci_bus *bus, unsigned int devfn,
>  
>  	ret = rcar_pcie_config_access(host, RCAR_PCI_ACCESS_READ,
>  				      bus, devfn, where, val);
> -	if (ret != 0) {
> +	if (ret) {
>  		*val = 0xffffffff;
>  		return ret;
>  	}
> @@ -184,7 +184,7 @@ static int rcar_pcie_write_conf(struct pci_bus *bus, unsigned int devfn,
>  
>  	ret = rcar_pcie_config_access(host, RCAR_PCI_ACCESS_READ,
>  				      bus, devfn, where, &data);
> -	if (ret != 0)
> +	if (ret)
>  		return ret;
>  
>  	dev_dbg(&bus->dev, "pcie-config-write: bus=%3d devfn=0x%04x where=0x%04x size=%d val=0x%08x\n",
> -- 
> 2.18.2

Seems harmless to me.




_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13 12:22 [RFC PATCH 00/35] Move all PCIBIOS* definitions into arch/x86 Saheed O. Bolarinwa
2020-07-13 12:22 ` [RFC PATCH 05/35] PCI: Change PCIBIOS_SUCCESSFUL to 0 Saheed O. Bolarinwa
2020-07-13 12:22 ` [RFC PATCH 06/35] PCI: Tidy Success/Failure checks Saheed O. Bolarinwa
2020-07-13 13:59   ` Gustavo Pimentel [this message]
2020-07-13 15:08 ` [RFC PATCH 00/35] Move all PCIBIOS* definitions into arch/x86 Arnd Bergmann
2020-07-13 22:01 ` 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=DM5PR12MB12762A48A839874F3CC59AEEDA600@DM5PR12MB1276.namprd12.prod.outlook.com \
    --to=gustavo.pimentel@synopsys.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bjorn@helgaas.com \
    --cc=helgaas@kernel.org \
    --cc=jingoohan1@gmail.com \
    --cc=khilman@baylibre.com \
    --cc=ley.foon.tan@intel.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=marek.vasut+renesas@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=refactormyself@gmail.com \
    --cc=rfi@lists.rocketboards.org \
    --cc=rjui@broadcom.com \
    --cc=robh@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=skhan@linuxfoundation.org \
    --cc=toan@os.amperecomputing.com \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    --cc=yue.wang@Amlogic.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

Linux-Amlogic Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-amlogic/0 linux-amlogic/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-amlogic linux-amlogic/ https://lore.kernel.org/linux-amlogic \
		linux-amlogic@lists.infradead.org
	public-inbox-index linux-amlogic

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-amlogic


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git