Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4668832rwd; Sun, 11 Jun 2023 12:21:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5anyPZj9VpEeazbUKlhco9HdIcmahdUVeqm87rnQcCIbFs9Uv0xzzg7oWDqM2Cit1PR1Yx X-Received: by 2002:a17:90a:e010:b0:25b:d14f:7857 with SMTP id u16-20020a17090ae01000b0025bd14f7857mr2226809pjy.34.1686511293449; Sun, 11 Jun 2023 12:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686511293; cv=none; d=google.com; s=arc-20160816; b=SK9Ssy6LmC2Z80dIqFpNDkOT5ASO5HYfgFM3erjkO60k7zUCGu0keisgtWP2Hke9tb XcH9WnhTpBtDUIIDe/jQGn86qAT4+28YlwuwYdCK44K5c8DiN9KeaJY44kfmkt1sIWhS JZ6uvKZe+dpbUVhvrwbdw7VEnOaPAzGXtbf6meEyTp38LaQlMmKOCXWw2jiP3HL9x3Ll THMSfpI74/QPa9+sW065cBjubEnEzl98nnVVMsJSdxvNnwWtDbUBEAzOUBfAexnodUx7 kqRDaOBc2vV7cZhdiYcQlqe9M4WFJEC6UwrJlhzgqNb6+Fz3bnHtddkpoodfqpELvl3L kScQ== 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=LHPyA9tgRl2Gs6Hh3GgNy+g6dEDqK2VKmPfH8Gos1h8=; b=QT8YutlmDgdi13Zi6Kj+m0lrIcjnK7rycxel0gv+NKPWYiTBCZ2kHiFK7qNpyxLGbg PhjRMKWNPe79SK7LKg7qSPWviM6ElfQvCLFfExdCL+8xkcMxgn4olpEn0FQapE58hbcd Llc+C6AUmP7vPbfAEuQeDkMlXFrKH+v7/DUBFbvUZr9ww5ZhuLyzfjzkr1FA0Ndk/OfI eKbrOgxjWAAA8WUsWUly4tGgeXCZSki3GYJRXIGJWEIYSybHsmb1DyvMfOCnHuKlIsiu /J3yXmYtT+7koTXZVmfU+u71/H6mJMfO1cxdQNdbn+8GbcpRM0mCE8rVYf2Uy5MLu6bB 4Vew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=post header.b=rzktQVvc; 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 nv13-20020a17090b1b4d00b00250331e6044si3500839pjb.25.2023.06.11.12.21.21; Sun, 11 Jun 2023 12:21:33 -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=rzktQVvc; 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 S233793AbjFKTUZ (ORCPT + 99 others); Sun, 11 Jun 2023 15:20:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjFKTUN (ORCPT ); Sun, 11 Jun 2023 15:20:13 -0400 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2E668E51; Sun, 11 Jun 2023 12:20:10 -0700 (PDT) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id 68E57E0DEC; Sun, 11 Jun 2023 22:20:08 +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=LHPyA9tgRl2Gs6Hh3GgNy+g6dEDqK2VKmPfH8Gos1h8=; b=rzktQVvcdFtt X6C0Us+9c7XaKWsv0W7j6zi+m2S9ymWdvjwaXJubRQT8RVYdDzmI/n6/7kvcDGvp cGCQ1Oc/+p52U47jXuEVNO3IamQVHD5YpQyNDK8FQpTEeVlNBzw/kG0rKAaqayyT xJJkZgVsaAyTD3coifbRWuu4WmKWdms= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id 3C967E0DE3; Sun, 11 Jun 2023 22:20:08 +0300 (MSK) Received: from localhost (10.8.30.10) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sun, 11 Jun 2023 22:20:07 +0300 From: Serge Semin To: Bjorn Helgaas , Lorenzo Pieralisi , Jingoo Han , Gustavo Pimentel , 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 v7 01/11] PCI: dwc: Fix erroneous version type test helper Date: Sun, 11 Jun 2023 22:19:55 +0300 Message-ID: <20230611192005.25636-2-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230611192005.25636-1-Sergey.Semin@baikalelectronics.ru> References: <20230611192005.25636-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.8.30.10] 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 Reviewed-by: Yoshihiro Shimoda --- 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