From patchwork Tue Aug 8 04:08:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiongfeng Wang X-Patchwork-Id: 13346922 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C4D5C001B0 for ; Tue, 8 Aug 2023 19:50:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229840AbjHHTun (ORCPT ); Tue, 8 Aug 2023 15:50:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231781AbjHHTuW (ORCPT ); Tue, 8 Aug 2023 15:50:22 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02AE64FB00 for ; Tue, 8 Aug 2023 09:56:00 -0700 (PDT) Received: from dggpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4RKfSR5cbkz1hwCb; Tue, 8 Aug 2023 11:53:59 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 8 Aug 2023 11:56:47 +0800 From: Xiongfeng Wang To: , , , , , , , , CC: , , , , , , Subject: [PATCH v2 0/2] Introduce pci_find_next_dvsec_capability() to simplify the code Date: Tue, 8 Aug 2023 12:08:56 +0800 Message-ID: <20230808040858.183568-1-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Some devices may have several DVSEC (Designated Vendor-Specific Extended Capability) entries with the same DVSEC ID. Introduce pci_find_next_dvsec_capability() to simplify the code. ChangeLog: v1->v2: Add Reviewed-by and Acked-by tags Modify commit message and document a little for the first patch Xiongfeng Wang (2): PCI: Add pci_find_next_dvsec_capability to find next Designated VSEC ocxl: use pci_find_next_dvsec_capability() to simplify the code arch/powerpc/platforms/powernv/ocxl.c | 20 ++------------ drivers/misc/ocxl/config.c | 21 +++++---------- drivers/pci/pci.c | 39 ++++++++++++++++++--------- include/linux/pci.h | 2 ++ include/misc/ocxl-config.h | 4 --- 5 files changed, 36 insertions(+), 50 deletions(-)