Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp9270893rwr; Thu, 11 May 2023 12:22:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Yh1DOMlygQj/fuiltXSvpJi05NOKyg29+3KZMDm/TNrKfXq2dPKsn/QYGdNcdS5+yVwNV X-Received: by 2002:a05:6a20:549c:b0:102:7aec:6dcc with SMTP id i28-20020a056a20549c00b001027aec6dccmr9932127pzk.27.1683832960141; Thu, 11 May 2023 12:22:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683832960; cv=none; d=google.com; s=arc-20160816; b=UxC/JVM4ujcX9LwXhhDd7l4BXUO4+lj/S22j9WT7znT+bCfoTXu8A4e9ZG8t0+ZngK e3xwY2MVOVQSXc/EnVUDNFQeHS/CF8perloLEi7k7epDnvTJljR1x64k6egO3jsgebY1 JivNkaHTDYK8b6Lwj0LQgfVNXq4fL6hTqT3l15G9HsTG7vxMXo9gqWoSPi7BDfrsLNRx 3Hqi//KOfi7pO0FW89Ey+oxZbKhtNbjuwXVJtidUcs4PtO+xz5UC4GLQp+BQgwaAaHfp ycdk9F9hhEWjabq6bJXoG6QrTq3kY84hpVbtEpuiyD6jHk47GfwtqKIDFqbqUSlgmiQt Fvqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qQLytNfopdgHPumxz2z0/0fOGOZTZb5joxvj+7jJrYs=; b=goYunYoFvV3R4nETZslj2nlL5vCqcKO5Qh1yuhiAi8ylQU4XEBoUEUv3TfryzaLsfZ i5W2B1BLw5nG15qOz2y4ZRx9Ob5d0xQxuHsy36NE8lRLX8f/6kTOajGXEAn3XscqRKEf 2rJx41xw1t23MI+uePo/avuZxix1XWuZ4BZ0upT9pQmyJOCa/rRUuu01ydXRWkGvL5Ck OscBJvc0ije5g/GiIoSCGjS7lRGZ9fLzqEGoHGgre4z6UMvtcmlAmb5xkOzD0UxmOMYW cBY+9YXI/QFnffvIvRj8YXpgUo+L2CjGg3Utx8EthFy8LrdfwCuGBtt53RFJWu7C4S7I sQWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=post header.b=MngruMBJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=baikalelectronics.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z1-20020aa79481000000b0062a450c329dsi8278309pfk.93.2023.05.11.12.22.27; Thu, 11 May 2023 12:22:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=post header.b=MngruMBJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=baikalelectronics.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238452AbjEKTJk (ORCPT + 99 others); Thu, 11 May 2023 15:09:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238666AbjEKTJY (ORCPT ); Thu, 11 May 2023 15:09:24 -0400 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5AD8A5B97; Thu, 11 May 2023 12:09:20 -0700 (PDT) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id 1C6AAE0EBB; Thu, 11 May 2023 22:09:18 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-transfer-encoding :content-type:content-type:date:from:from:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=post; bh=qQLytNfopdgHPumxz2z0/0fOGOZTZb5joxvj+7jJrYs=; b=MngruMBJxaNy 5wMflv4fTeVyuyW0LgqD6IuRiREl1AENxzD3Kt3+Jon1DR7GeQ0M9bN2tcTQAj+d QTsAE4Ovp8zsZkUEPcx/ojrmQA6bGRHZfsppxGwG46bmDPNhNbQLIoP4FGWjoNPf CbJS9GGVAazXqbjU5HAjSkhVX9UHv8c= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id 01C57E0EB1; Thu, 11 May 2023 22:09:18 +0300 (MSK) Received: from localhost (10.8.30.6) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 11 May 2023 22:09:17 +0300 From: Serge Semin To: Bjorn Helgaas , Lorenzo Pieralisi , Cai Huoqing , Jingoo Han , Gustavo Pimentel , Vinod Koul , Manivannan Sadhasivam , Yoshihiro Shimoda , Rob Herring , Manivannan Sadhasivam , Serge Semin , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= CC: Serge Semin , Alexey Malahov , Pavel Parkhomenko , , , Subject: [PATCH RESEND v5 01/14] PCI: dwc: Fix erroneous version type test helper Date: Thu, 11 May 2023 22:08:49 +0300 Message-ID: <20230511190902.28896-2-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230511190902.28896-1-Sergey.Semin@baikalelectronics.ru> References: <20230511190902.28896-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.8.30.6] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Manivannan Sadhasivam --- 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