Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4944797rwl; Mon, 10 Apr 2023 20:41:42 -0700 (PDT) X-Google-Smtp-Source: AKy350b4E3HpUI4ljjHtNeKUhiLlrISsygdhlb7QKLGm5yMPTmO0oaXG8xPMGMIhf6shSBYqAQvq X-Received: by 2002:a17:907:8c17:b0:94a:98e8:b374 with SMTP id ta23-20020a1709078c1700b0094a98e8b374mr4873581ejc.62.1681184501903; Mon, 10 Apr 2023 20:41:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681184501; cv=none; d=google.com; s=arc-20160816; b=WiB6XK1VAGmGizSGg6fbEalBMF3QM4I/FnAL91RbPrwxZ3bRhzurRHwdfZ2S+kLtKj sgr1Ls7/b8uyREpjI12WEpxayB8U3ML74hEI442+CgBdvsWqJUZGDB/IxnSR7Cwn7JF+ d6cIzK8tHmsI3LcZDHzJGhw1OHxMVd16Oc4qZl1rkmO+QLCS3jAUI6RLjLUlBWEqrc8U uDgAZ1Ggij7VxXvl2Xj2FuHIitMXHK8N+05of0WZaUFSDU+JN0grRHLmi/bjgiuGPGg3 R3WjhgrNzHD9KzcTn7GZDVmg5OXxKtZh33wG1Ui+18F1Jp7HxiNXBi5asj+8nav7Cen6 mC5w== 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=dhe5fI/NAb096CUtikyh7zdL7QAzlkNeqQb7gzpNoGQ=; b=qmPRR74dcUpMcjuB0D/xtBNHXZI4aRj4oucnAsgwG/xLCzP1vm6/FpKsYrp6D6lclE ftMZHmzPEdnmzh0ZJ1SCNMpnyOjbYPiG7y/vEEuQZJ5hGM3ySju0JctUHOEh7tAbxxjo /pt4iutDJpl06KzcV1Ao4jcvSUo3yKAPDYK08pxpQu9aiw0xUtknR1/re52uRjuzrJ/6 XdxWiGp5G/X/I1LoP0GYsYUyq78oXCFQBEZ5blFFs8AYRmvFGU3WnlymlwSX6kNUT3IA L9HUcX3+fz8o/4VO+xcRcWBvrqodw2yfiiRjfU16ftHF/2IMjFV+/qcCvxiyqPDWEIN/ NZ2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=post header.b="jO5/qNV/"; 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 hp32-20020a1709073e2000b00939577d1d96si12974098ejc.173.2023.04.10.20.41.16; Mon, 10 Apr 2023 20:41:41 -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="jO5/qNV/"; 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 S229974AbjDKDkW (ORCPT + 99 others); Mon, 10 Apr 2023 23:40:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229914AbjDKDjw (ORCPT ); Mon, 10 Apr 2023 23:39:52 -0400 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DD7CF1BFC; Mon, 10 Apr 2023 20:39:47 -0700 (PDT) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id 60DE4E0EAA; Tue, 11 Apr 2023 06:39:45 +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=dhe5fI/NAb096CUtikyh7zdL7QAzlkNeqQb7gzpNoGQ=; b=jO5/qNV/XUsm qyc3iswjovf49leh7tHcz8t63Bucd+qBaKNJoB6MOSTsslARXmR+cK8Dw8TcE5k1 rKJ/pbe4tUViJZZZRwbiCWdbsmoBC4nq5yHqWoZmydJcZXpSXWjs5A/S0ObLVrTQ qn/LFoKvM/Eq+Nl+HIXmwCSNWHOW2so= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id 4B7B5E0E6A; Tue, 11 Apr 2023 06:39:45 +0300 (MSK) Received: from localhost (10.8.30.38) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 11 Apr 2023 06:39:45 +0300 From: Serge Semin To: Bjorn Helgaas , Lorenzo Pieralisi , Cai Huoqing , Jingoo Han , Gustavo Pimentel , Vinod Koul , Manivannan Sadhasivam , Yoshihiro Shimoda , Rob Herring , Serge Semin , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= CC: Serge Semin , Alexey Malahov , Pavel Parkhomenko , , , Subject: [PATCH RESEND v3 01/10] PCI: dwc: Fix erroneous version type test helper Date: Tue, 11 Apr 2023 06:39:19 +0300 Message-ID: <20230411033928.30397-2-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230411033928.30397-1-Sergey.Semin@baikalelectronics.ru> References: <20230411033928.30397-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.8.30.38] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 --- 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