From patchwork Mon Sep 11 08:08:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: oushixiong X-Patchwork-Id: 13378961 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 C27F5EE7FF4 for ; Mon, 11 Sep 2023 08:09:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234359AbjIKIJO (ORCPT ); Mon, 11 Sep 2023 04:09:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234474AbjIKIJM (ORCPT ); Mon, 11 Sep 2023 04:09:12 -0400 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 224E2CD7; Mon, 11 Sep 2023 01:08:40 -0700 (PDT) X-UUID: 838370dd57ee48bb9b52dc0ff3bc3b20-20230911 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.31,REQID:0ebd95a8-eab7-4741-af2d-9bb3daf083da,IP:15, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:0 X-CID-INFO: VERSION:1.1.31,REQID:0ebd95a8-eab7-4741-af2d-9bb3daf083da,IP:15,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:0 X-CID-META: VersionHash:0ad78a4,CLOUDID:5efce1c2-1e57-4345-9d31-31ad9818b39f,B ulkID:230911160834LYXXCYPN,BulkQuantity:0,Recheck:0,SF:19|44|24|17|102,TC: nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OS I:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 838370dd57ee48bb9b52dc0ff3bc3b20-20230911 X-User: oushixiong@kylinos.cn Received: from localhost.localdomain [(111.48.58.12)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 1290505474; Mon, 11 Sep 2023 16:08:31 +0800 From: oushixiong To: Jason Gunthorpe Cc: Yishai Hadas , Shameer Kolothum , Kevin Tian , Brett Creeley , Alex Williamson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Shixiong Ou Subject: [PATCH] vfio/pds: Using pci_physfn() to fix a compilation issue Date: Mon, 11 Sep 2023 16:08:28 +0800 Message-Id: <20230911080828.635184-1-oushixiong@kylinos.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Shixiong Ou If PCI_ATS isn't set, then pdev->physfn is not defined. it causes a compilation issue: ../drivers/vfio/pci/pds/vfio_dev.c:165:30: error: ‘struct pci_dev’ has no member named ‘physfn’; did you mean ‘is_physfn’? 165 | __func__, pci_dev_id(pdev->physfn), pci_id, vf_id, | ^~~~~~ So using pci_physfn() rather than using pdev->physfn directly. Signed-off-by: Shixiong Ou Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe --- drivers/vfio/pci/pds/vfio_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/pci/pds/vfio_dev.c b/drivers/vfio/pci/pds/vfio_dev.c index b46174f5eb09..649b18ee394b 100644 --- a/drivers/vfio/pci/pds/vfio_dev.c +++ b/drivers/vfio/pci/pds/vfio_dev.c @@ -162,7 +162,7 @@ static int pds_vfio_init_device(struct vfio_device *vdev) pci_id = PCI_DEVID(pdev->bus->number, pdev->devfn); dev_dbg(&pdev->dev, "%s: PF %#04x VF %#04x vf_id %d domain %d pds_vfio %p\n", - __func__, pci_dev_id(pdev->physfn), pci_id, vf_id, + __func__, pci_dev_id(pci_physfn(pdev)), pci_id, vf_id, pci_domain_nr(pdev->bus), pds_vfio); return 0;