Linux-PCI Archive on lore.kernel.org
 help / color / Atom feed
From: Alexander Lobakin <alobakin@pm.me>
To: Bjorn Helgaas <bhelgaas@google.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Jingoo Han <jingoohan1@gmail.com>,
	Gustavo Pimentel <gustavo.pimentel@synopsys.com>,
	Rob Herring <robh@kernel.org>, Vidya Sagar <vidyas@nvidia.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Alexander Lobakin <alobakin@pm.me>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH pci] PCI: dwc: fix inverted condition of DMA mask setup warning
Date: Tue, 22 Dec 2020 15:07:43 +0000
Message-ID: <20201222150708.67983-1-alobakin@pm.me> (raw)

Commit 660c486590aa ("PCI: dwc: Set 32-bit DMA mask for MSI target
address allocation") added dma_mask_set() call to explicitly set
32-bit DMA mask for MSI message mapping, but for now it throws a
warning on ret == 0, while dma_set_mask() returns 0 in case of
success.
Fix this by inverting the condition.

Misc: remove redundant braces around single statement.

Fixes: 660c486590aa ("PCI: dwc: Set 32-bit DMA mask for MSI target address allocation")
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
---
 drivers/pci/controller/dwc/pcie-designware-host.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index 516b151e0ef3..fa40cc2e376f 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -397,12 +397,11 @@ int dw_pcie_host_init(struct pcie_port *pp)
 							    pp);
 
 			ret = dma_set_mask(pci->dev, DMA_BIT_MASK(32));
-			if (!ret) {
+			if (ret)
 				dev_warn(pci->dev,
 					 "Failed to set DMA mask to 32-bit. "
 					 "Devices with only 32-bit MSI support"
 					 " may not work properly\n");
-			}
 
 			pp->msi_data = dma_map_single_attrs(pci->dev, &pp->msi_msg,
 						      sizeof(pp->msi_msg),
-- 
2.29.2



             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-22 15:07 Alexander Lobakin [this message]
2020-12-23 18:58 ` 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=20201222150708.67983-1-alobakin@pm.me \
    --to=alobakin@pm.me \
    --cc=bhelgaas@google.com \
    --cc=gustavo.pimentel@synopsys.com \
    --cc=jingoohan1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=vidyas@nvidia.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-PCI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-pci/0 linux-pci/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-pci linux-pci/ https://lore.kernel.org/linux-pci \
		linux-pci@vger.kernel.org
	public-inbox-index linux-pci

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-pci


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