From nobody Mon Feb 9 09:53:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1690810559269959.8689895699749; Mon, 31 Jul 2023 06:35:59 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.573059.897388 (Exim 4.92) (envelope-from ) id 1qQT3m-0000MJ-HE; Mon, 31 Jul 2023 13:35:42 +0000 Received: by outflank-mailman (output) from mailman id 573059.897388; Mon, 31 Jul 2023 13:35:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qQT3m-0000MA-E9; Mon, 31 Jul 2023 13:35:42 +0000 Received: by outflank-mailman (input) for mailman id 573059; Mon, 31 Jul 2023 13:35:41 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qQT3l-0008Hl-9w for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 13:35:41 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 23708b65-2fa7-11ee-8613-37d641c3527e; Mon, 31 Jul 2023 15:35:39 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 6C4024EE0741; Mon, 31 Jul 2023 15:35:38 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 23708b65-2fa7-11ee-8613-37d641c3527e From: Nicola Vetrini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Nicola Vetrini , Jan Beulich , Andrew Cooper Subject: [XEN PATCH 2/4] amd/iommu: rename functions to address MISRA C:2012 Rule 5.3 Date: Mon, 31 Jul 2023 15:35:00 +0200 Message-Id: <838e606bfe8b83578970ce73a1ac7d71ccefcd2b.1690810346.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1690810560088100005 Content-Type: text/plain; charset="utf-8" The functions 'machine_bfd' and 'guest_bfd' have gained the prefix 'get_' to avoid the mutual shadowing with the homonymous parameters in these functions. Signed-off-by: Nicola Vetrini Acked-by: Jan Beulich Reviewed-by: Stefano Stabellini --- xen/drivers/passthrough/amd/iommu_guest.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xen/drivers/passthrough/amd/iommu_guest.c b/xen/drivers/passth= rough/amd/iommu_guest.c index 80a331f546..47a912126a 100644 --- a/xen/drivers/passthrough/amd/iommu_guest.c +++ b/xen/drivers/passthrough/amd/iommu_guest.c @@ -38,12 +38,12 @@ (reg)->hi =3D (val) >> 32; \ } while (0) =20 -static unsigned int machine_bdf(struct domain *d, uint16_t guest_bdf) +static unsigned int get_machine_bdf(struct domain *d, uint16_t guest_bdf) { return guest_bdf; } =20 -static uint16_t guest_bdf(struct domain *d, uint16_t machine_bdf) +static uint16_t get_guest_bdf(struct domain *d, uint16_t machine_bdf) { return machine_bdf; } @@ -195,7 +195,7 @@ void guest_iommu_add_ppr_log(struct domain *d, u32 entr= y[]) log =3D map_domain_page(_mfn(mfn)) + (tail & ~PAGE_MASK); =20 /* Convert physical device id back into virtual device id */ - gdev_id =3D guest_bdf(d, iommu_get_devid_from_cmd(entry[0])); + gdev_id =3D get_guest_bdf(d, iommu_get_devid_from_cmd(entry[0])); iommu_set_devid_to_cmd(&entry[0], gdev_id); =20 memcpy(log, entry, sizeof(ppr_entry_t)); @@ -245,7 +245,7 @@ void guest_iommu_add_event_log(struct domain *d, u32 en= try[]) log =3D map_domain_page(_mfn(mfn)) + (tail & ~PAGE_MASK); =20 /* re-write physical device id into virtual device id */ - dev_id =3D guest_bdf(d, iommu_get_devid_from_cmd(entry[0])); + dev_id =3D get_guest_bdf(d, iommu_get_devid_from_cmd(entry[0])); iommu_set_devid_to_cmd(&entry[0], dev_id); memcpy(log, entry, sizeof(event_entry_t)); =20 @@ -268,7 +268,7 @@ static int do_complete_ppr_request(struct domain *d, cm= d_entry_t *cmd) uint16_t dev_id; struct amd_iommu *iommu; =20 - dev_id =3D machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0])); + dev_id =3D get_machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0])); iommu =3D find_iommu_for_device(0, dev_id); =20 if ( !iommu ) @@ -320,7 +320,7 @@ static int do_invalidate_iotlb_pages(struct domain *d, = cmd_entry_t *cmd) struct amd_iommu *iommu; uint16_t dev_id; =20 - dev_id =3D machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0])); + dev_id =3D get_machine_bdf(d, iommu_get_devid_from_cmd(cmd->data[0])); =20 iommu =3D find_iommu_for_device(0, dev_id); if ( !iommu ) @@ -396,7 +396,7 @@ static int do_invalidate_dte(struct domain *d, cmd_entr= y_t *cmd) =20 g_iommu =3D domain_iommu(d); gbdf =3D iommu_get_devid_from_cmd(cmd->data[0]); - mbdf =3D machine_bdf(d, gbdf); + mbdf =3D get_machine_bdf(d, gbdf); =20 /* Guest can only update DTEs for its passthru devices */ if ( mbdf =3D=3D 0 || gbdf =3D=3D 0 ) --=20 2.34.1