public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
To: "Bjorn Helgaas" <bhelgaas@google.com>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Cai Huoqing" <cai.huoqing@linux.dev>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Gustavo Pimentel" <gustavo.pimentel@synopsys.com>,
	"Vinod Koul" <vkoul@kernel.org>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
	"Rob Herring" <robh@kernel.org>,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	"Serge Semin" <fancer.lancer@gmail.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>
Cc: Serge Semin <Sergey.Semin@baikalelectronics.ru>,
	Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
	Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>,
	<linux-pci@vger.kernel.org>, <dmaengine@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH RESEND v5 01/14] PCI: dwc: Fix erroneous version type test helper
Date: Thu, 11 May 2023 22:08:49 +0300	[thread overview]
Message-ID: <20230511190902.28896-2-Sergey.Semin@baikalelectronics.ru> (raw)
In-Reply-To: <20230511190902.28896-1-Sergey.Semin@baikalelectronics.ru>

Due to an unfortunate mistake the macro function actually checks the
IP-core version instead of the IP-core version type which isn't what
originally implied. Fix it by introducing a new helper
__dw_pcie_ver_type_cmp() with the same semantic as the __dw_pcie_ver_cmp()
counterpart except it refers to the dw_pcie.type field in order to perform
the passed comparison operation.

Fixes: 0b0a780d52ad ("PCI: dwc: Add macros to compare Synopsys IP core versions")
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/pci/controller/dwc/pcie-designware.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h
index 79713ce075cc..adad0ea61799 100644
--- a/drivers/pci/controller/dwc/pcie-designware.h
+++ b/drivers/pci/controller/dwc/pcie-designware.h
@@ -37,17 +37,20 @@
 #define __dw_pcie_ver_cmp(_pci, _ver, _op) \
 	((_pci)->version _op DW_PCIE_VER_ ## _ver)
 
+#define __dw_pcie_ver_type_cmp(_pci, _type, _op) \
+	((_pci)->type _op DW_PCIE_VER_TYPE_ ## _type)
+
 #define dw_pcie_ver_is(_pci, _ver) __dw_pcie_ver_cmp(_pci, _ver, ==)
 
 #define dw_pcie_ver_is_ge(_pci, _ver) __dw_pcie_ver_cmp(_pci, _ver, >=)
 
 #define dw_pcie_ver_type_is(_pci, _ver, _type) \
 	(__dw_pcie_ver_cmp(_pci, _ver, ==) && \
-	 __dw_pcie_ver_cmp(_pci, TYPE_ ## _type, ==))
+	 __dw_pcie_ver_type_cmp(_pci, _type, ==))
 
 #define dw_pcie_ver_type_is_ge(_pci, _ver, _type) \
 	(__dw_pcie_ver_cmp(_pci, _ver, ==) && \
-	 __dw_pcie_ver_cmp(_pci, TYPE_ ## _type, >=))
+	 __dw_pcie_ver_type_cmp(_pci, _type, >=))
 
 /* DWC PCIe controller capabilities */
 #define DW_PCIE_CAP_REQ_RES		0
-- 
2.40.0



  reply	other threads:[~2023-05-11 19:09 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 19:08 [PATCH RESEND v5 00/14] PCI: dwc: Relatively simple fixes and cleanups Serge Semin
2023-05-11 19:08 ` Serge Semin [this message]
2023-05-12  9:55   ` [PATCH RESEND v5 01/14] PCI: dwc: Fix erroneous version type test helper Yoshihiro Shimoda
2023-05-12 10:23     ` Serge Semin
2023-05-11 19:08 ` [PATCH RESEND v5 02/14] PCI: dwc: Fix inbound iATU entries out-of-bounds warning message Serge Semin
2023-05-12  9:55   ` Yoshihiro Shimoda
2023-05-11 19:08 ` [PATCH RESEND v5 03/14] PCI: bt1: Enable async probe type Serge Semin
2023-05-11 19:08 ` [PATCH RESEND v5 04/14] PCI: bt1: Fix printing false error message Serge Semin
2023-05-11 19:08 ` [PATCH RESEND v5 05/14] PCI: dwc: Drop duplicated fast-link-mode flag unsetting Serge Semin
2023-05-12  9:55   ` Yoshihiro Shimoda
2023-05-11 19:08 ` [PATCH RESEND v5 06/14] PCI: dwc: Drop empty line from dw_pcie_link_set_max_speed() Serge Semin
2023-05-12  9:56   ` Yoshihiro Shimoda
2023-05-11 19:08 ` [PATCH RESEND v5 07/14] PCI: visconti: Convert to using generic resources getter Serge Semin
2023-05-17  5:29   ` Manivannan Sadhasivam
2023-05-11 19:08 ` [PATCH RESEND v5 08/14] MAINTAINERS: Add all generic DW PCIe RP/EP DT-schemas Serge Semin
2023-05-11 19:08 ` [PATCH RESEND v5 09/14] MAINTAINERS: Demote Gustavo Pimentel to DW PCIe core reviewer Serge Semin
2023-05-17  5:30   ` Manivannan Sadhasivam
2023-05-11 19:08 ` [PATCH RESEND v5 10/14] MAINTAINERS: Add Manivannan to DW PCIe core maintainers list Serge Semin
2023-05-17  5:31   ` Manivannan Sadhasivam
2023-05-11 19:08 ` [PATCH RESEND v5 11/14] MAINTAINERS: Add myself as the DW PCIe core reviewer Serge Semin
2023-05-11 19:09 ` [PATCH RESEND v5 12/14] MAINTAINERS: Demote Gustavo Pimentel to DW EDMA driver reviewer Serge Semin
2023-05-17  5:31   ` Manivannan Sadhasivam
2023-05-17  8:12     ` Vinod Koul
2023-05-11 19:09 ` [PATCH RESEND v5 13/14] MAINTAINERS: Add Manivannan to DW eDMA driver maintainers list Serge Semin
2023-05-17  5:28   ` Manivannan Sadhasivam
2023-05-17  8:12     ` Vinod Koul
2023-05-17 19:38       ` Serge Semin
2023-05-11 19:09 ` [PATCH RESEND v5 14/14] MAINTAINERS: Add myself as the DW eDMA driver reviewer Serge Semin
2023-05-18  9:32   ` Vinod Koul

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=20230511190902.28896-2-Sergey.Semin@baikalelectronics.ru \
    --to=sergey.semin@baikalelectronics.ru \
    --cc=Alexey.Malahov@baikalelectronics.ru \
    --cc=Pavel.Parkhomenko@baikalelectronics.ru \
    --cc=bhelgaas@google.com \
    --cc=cai.huoqing@linux.dev \
    --cc=dmaengine@vger.kernel.org \
    --cc=fancer.lancer@gmail.com \
    --cc=gustavo.pimentel@synopsys.com \
    --cc=jingoohan1@gmail.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=robh@kernel.org \
    --cc=vkoul@kernel.org \
    --cc=yoshihiro.shimoda.uh@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