From nobody Fri May 17 03:39:40 2024 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 1698157926649758.8746900217694; Tue, 24 Oct 2023 07:32:06 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.622034.969123 (Exim 4.92) (envelope-from ) id 1qvIRe-0005ra-2T; Tue, 24 Oct 2023 14:31:46 +0000 Received: by outflank-mailman (output) from mailman id 622034.969123; Tue, 24 Oct 2023 14:31:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qvIRd-0005qG-U3; Tue, 24 Oct 2023 14:31:45 +0000 Received: by outflank-mailman (input) for mailman id 622034; Tue, 24 Oct 2023 14:31:45 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qvIRd-0005kh-1l for xen-devel@lists.xenproject.org; Tue, 24 Oct 2023 14:31:45 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0e27b213-727a-11ee-98d5-6d05b1d4d9a1; Tue, 24 Oct 2023 16:31:44 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 296784EE0746; Tue, 24 Oct 2023 16:31:43 +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: 0e27b213-727a-11ee-98d5-6d05b1d4d9a1 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, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Nicola Vetrini , Wei Liu Subject: [RFC 1/4] x86/ioemul: address MISRA C:2012 Rule 9.3 Date: Tue, 24 Oct 2023 16:31:35 +0200 Message-Id: <76c9f78179a8bb5b4f99b34f163933394f79066c.1698155925.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: 1698157927765100001 Content-Type: text/plain; charset="utf-8" Partially explicitly initalized .matches arrays result in violations of Rule 9.3; this is resolved by using designated initializers, which is permitted by the Rule. Mechanical changes. Signed-off-by: Nicola Vetrini --- xen/arch/x86/ioport_emulate.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/xen/arch/x86/ioport_emulate.c b/xen/arch/x86/ioport_emulate.c index 6caeb3d470ce..4f8d5136746d 100644 --- a/xen/arch/x86/ioport_emulate.c +++ b/xen/arch/x86/ioport_emulate.c @@ -44,57 +44,57 @@ static const struct dmi_system_id __initconstrel ioport= _quirks_tbl[] =3D { { .ident =3D "HP ProLiant DL3xx", .matches =3D { - DMI_MATCH(DMI_BIOS_VENDOR, "HP"), - DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL3"), + [0] =3D DMI_MATCH(DMI_BIOS_VENDOR, "HP"), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL3"), }, }, { .ident =3D "HP ProLiant DL5xx", .matches =3D { - DMI_MATCH(DMI_BIOS_VENDOR, "HP"), - DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL5"), + [0] =3D DMI_MATCH(DMI_BIOS_VENDOR, "HP"), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL5"), }, }, { .ident =3D "HP ProLiant DL7xx", .matches =3D { - DMI_MATCH(DMI_BIOS_VENDOR, "HP"), - DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL7"), + [0] =3D DMI_MATCH(DMI_BIOS_VENDOR, "HP"), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL7"), }, }, { .ident =3D "HP ProLiant ML3xx", .matches =3D { - DMI_MATCH(DMI_BIOS_VENDOR, "HP"), - DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML3"), + [0] =3D DMI_MATCH(DMI_BIOS_VENDOR, "HP"), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML3"), }, }, { .ident =3D "HP ProLiant ML5xx", .matches =3D { - DMI_MATCH(DMI_BIOS_VENDOR, "HP"), - DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML5"), + [0] =3D DMI_MATCH(DMI_BIOS_VENDOR, "HP"), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant ML5"), }, }, { .ident =3D "HP ProLiant BL2xx", .matches =3D { - DMI_MATCH(DMI_BIOS_VENDOR, "HP"), - DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL2"), + [0] =3D DMI_MATCH(DMI_BIOS_VENDOR, "HP"), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL2"), }, }, { .ident =3D "HP ProLiant BL4xx", .matches =3D { - DMI_MATCH(DMI_BIOS_VENDOR, "HP"), - DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL4"), + [0] =3D DMI_MATCH(DMI_BIOS_VENDOR, "HP"), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL4"), }, }, { .ident =3D "HP ProLiant BL6xx", .matches =3D { - DMI_MATCH(DMI_BIOS_VENDOR, "HP"), - DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL6"), + [0] =3D DMI_MATCH(DMI_BIOS_VENDOR, "HP"), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL6"), }, }, { } -- 2.34.1 From nobody Fri May 17 03:39:40 2024 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 1698157932636816.4281072743554; Tue, 24 Oct 2023 07:32:12 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.622035.969137 (Exim 4.92) (envelope-from ) id 1qvIRg-0006Fh-9F; Tue, 24 Oct 2023 14:31:48 +0000 Received: by outflank-mailman (output) from mailman id 622035.969137; Tue, 24 Oct 2023 14:31:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qvIRg-0006Fa-6S; Tue, 24 Oct 2023 14:31:48 +0000 Received: by outflank-mailman (input) for mailman id 622035; Tue, 24 Oct 2023 14:31:46 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qvIRe-0005kh-QZ for xen-devel@lists.xenproject.org; Tue, 24 Oct 2023 14:31:46 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0eebeb4a-727a-11ee-98d5-6d05b1d4d9a1; Tue, 24 Oct 2023 16:31:45 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 6D9DF4EE0748; Tue, 24 Oct 2023 16:31:44 +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: 0eebeb4a-727a-11ee-98d5-6d05b1d4d9a1 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, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Nicola Vetrini , Wei Liu Subject: [RFC 2/4] x86/shutdown: address MISRA C:2012 Rule 9.3 Date: Tue, 24 Oct 2023 16:31:36 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1698157933592100003 Content-Type: text/plain; charset="utf-8" Partially explicitly initalized .matches arrays result in violations of Rule 9.3; this is resolved by using designated initializers, which is permitted by the Rule. Mechanical changes. Signed-off-by: Nicola Vetrini --- xen/arch/x86/shutdown.c | 152 ++++++++++++++++++++-------------------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c index 7619544d14da..382c948f81a4 100644 --- a/xen/arch/x86/shutdown.c +++ b/xen/arch/x86/shutdown.c @@ -188,8 +188,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_KBD, .ident =3D "Dell E520", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061") }, }, { /* Handle problems with rebooting on Dell 1300's */ @@ -197,8 +197,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_KBD, .ident =3D "Dell PowerEdge 1300", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), - DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/") }, }, { /* Handle problems with rebooting on Dell 300's */ @@ -206,8 +206,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_KBD, .ident =3D "Dell PowerEdge 300", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), - DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/") }, }, { /* Handle problems with rebooting on Dell Optiplex 745's SFF */ @@ -215,8 +215,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_KBD, .ident =3D "Dell OptiPlex 745", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745") }, }, { /* Handle problems with rebooting on Dell Optiplex 745's DFF */ @@ -225,8 +225,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .ident =3D "Dell OptiPlex 745", .matches =3D { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"), - DMI_MATCH(DMI_BOARD_NAME, "0MM599"), + [0] =3D DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"), + [1] =3D DMI_MATCH(DMI_BOARD_NAME, "0MM599") }, }, { /* Handle problems with rebooting on Dell Optiplex 745 with 0KW62= 6 */ @@ -235,8 +235,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .ident =3D "Dell OptiPlex 745", .matches =3D { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"), - DMI_MATCH(DMI_BOARD_NAME, "0KW626"), + [0] =3D DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"), + [1] =3D DMI_MATCH(DMI_BOARD_NAME, "0KW626") }, }, { /* Handle problems with rebooting on Dell Optiplex 330 with 0KP56= 1 */ @@ -245,8 +245,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .ident =3D "Dell OptiPlex 330", .matches =3D { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"), - DMI_MATCH(DMI_BOARD_NAME, "0KP561"), + [0] =3D DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"), + [1] =3D DMI_MATCH(DMI_BOARD_NAME, "0KP561") }, }, { /* Handle problems with rebooting on Dell Optiplex 360 with 0T656= F */ @@ -255,8 +255,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .ident =3D "Dell OptiPlex 360", .matches =3D { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 360"), - DMI_MATCH(DMI_BOARD_NAME, "0T656F"), + [0] =3D DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 360"), + [1] =3D DMI_MATCH(DMI_BOARD_NAME, "0T656F") }, }, { /* Handle problems with rebooting on Dell OptiPlex 760 with 0G919= G */ @@ -265,8 +265,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .ident =3D "Dell OptiPlex 760", .matches =3D { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 760"), - DMI_MATCH(DMI_BOARD_NAME, "0G919G"), + [0] =3D DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 760"), + [1] =3D DMI_MATCH(DMI_BOARD_NAME, "0G919G") }, }, { /* Handle problems with rebooting on Dell 2400's */ @@ -274,8 +274,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_KBD, .ident =3D "Dell PowerEdge 2400", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), - DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400") }, }, { /* Handle problems with rebooting on Dell T5400's */ @@ -283,8 +283,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_KBD, .ident =3D "Dell Precision T5400", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T54= 00") }, }, { /* Handle problems with rebooting on Dell T7400's */ @@ -292,8 +292,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_KBD, .ident =3D "Dell Precision T7400", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T7400"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T74= 00") }, }, { /* Handle problems with rebooting on HP laptops */ @@ -301,8 +301,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_KBD, .ident =3D "HP Compaq Laptop", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), - DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq") }, }, { /* Handle problems with rebooting on Dell XPS710 */ @@ -310,8 +310,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_KBD, .ident =3D "Dell XPS710", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710") }, }, { /* Handle problems with rebooting on Dell DXP061 */ @@ -319,8 +319,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_KBD, .ident =3D "Dell DXP061", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061") }, }, { /* Handle problems with rebooting on Sony VGN-Z540N */ @@ -328,8 +328,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_KBD, .ident =3D "Sony VGN-Z540N", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), - DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N") }, }, { /* Handle problems with rebooting on ASUS P4S800 */ @@ -337,8 +337,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_KBD, .ident =3D "ASUS P4S800", .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), - DMI_MATCH(DMI_BOARD_NAME, "P4S800"), + [0] =3D DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + [1] =3D DMI_MATCH(DMI_BOARD_NAME, "P4S800") }, }, { /* Handle reboot issue on Acer Aspire one */ @@ -346,8 +346,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_KBD, .ident =3D "Acer Aspire One A110", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "AOA110") }, }, { /* Handle problems with rebooting on Apple MacBook5 */ @@ -355,8 +355,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Apple MacBook5", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5") }, }, { /* Handle problems with rebooting on Apple MacBookPro5 */ @@ -364,8 +364,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Apple MacBookPro5", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5") }, }, { /* Handle problems with rebooting on Apple Macmini3,1 */ @@ -373,8 +373,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Apple Macmini3,1", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1") }, }, { /* Handle problems with rebooting on the iMac9,1. */ @@ -382,8 +382,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Apple iMac9,1", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1") }, }, { /* Handle problems with rebooting on the Latitude E6320. */ @@ -391,8 +391,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Dell Latitude E6320", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320") }, }, { /* Handle problems with rebooting on the Latitude E5420. */ @@ -400,8 +400,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Dell Latitude E5420", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420") }, }, { /* Handle problems with rebooting on the Latitude E6220. */ @@ -409,8 +409,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Dell Latitude E6220", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6220"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6220") }, }, { /* Handle problems with rebooting on the Latitude E6420. */ @@ -418,8 +418,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Dell Latitude E6420", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420") }, }, { /* Handle problems with rebooting on the OptiPlex 990. */ @@ -427,8 +427,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Dell OptiPlex 990", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990") }, }, { /* Handle problems with rebooting on the Precision M6600. */ @@ -436,8 +436,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Dell OptiPlex 990", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600") }, }, { /* Handle problems with rebooting on the Latitude E6520. */ @@ -445,8 +445,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Dell Latitude E6520", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520") }, }, { /* Handle problems with rebooting on the OptiPlex 790. */ @@ -454,8 +454,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Dell OptiPlex 790", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 790"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 790") }, }, { /* Handle problems with rebooting on the OptiPlex 990. */ @@ -463,8 +463,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Dell OptiPlex 990", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990") }, }, { /* Handle problems with rebooting on the OptiPlex 390. */ @@ -472,8 +472,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Dell OptiPlex 390", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 390"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 390") }, }, { /* Handle problems with rebooting on Dell OptiPlex 9020. */ @@ -481,8 +481,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_ACPI, .ident =3D "Dell OptiPlex 9020", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 9020"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 9020") }, }, { /* Handle problems with rebooting on the Latitude E6320. */ @@ -490,8 +490,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Dell Latitude E6320", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320") }, }, { /* Handle problems with rebooting on the Latitude E6420. */ @@ -499,8 +499,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Dell Latitude E6420", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420") }, }, { /* Handle problems with rebooting on the Latitude E6520. */ @@ -508,8 +508,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_CF9, .ident =3D "Dell Latitude E6520", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6520") }, }, { /* Handle problems with rebooting on Dell PowerEdge R540. */ @@ -517,8 +517,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_ACPI, .ident =3D "Dell PowerEdge R540", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R540"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R540") }, }, { /* Handle problems with rebooting on Dell PowerEdge R740. */ @@ -526,8 +526,8 @@ static const struct dmi_system_id __initconstrel reboot= _dmi_table[] =3D { .driver_data =3D (void *)(long)BOOT_ACPI, .ident =3D "Dell PowerEdge R740", .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R740"), + [0] =3D DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + [1] =3D DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R740") }, }, { } -- 2.34.1 From nobody Fri May 17 03:39:40 2024 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 1698157932206853.8577786324608; Tue, 24 Oct 2023 07:32:12 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.622036.969148 (Exim 4.92) (envelope-from ) id 1qvIRk-0006ZG-Jp; Tue, 24 Oct 2023 14:31:52 +0000 Received: by outflank-mailman (output) from mailman id 622036.969148; Tue, 24 Oct 2023 14:31:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qvIRk-0006Z3-Fz; Tue, 24 Oct 2023 14:31:52 +0000 Received: by outflank-mailman (input) for mailman id 622036; Tue, 24 Oct 2023 14:31:51 +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 1qvIRj-0006O8-90 for xen-devel@lists.xenproject.org; Tue, 24 Oct 2023 14:31:51 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 0f8711dd-727a-11ee-9b0e-b553b5be7939; Tue, 24 Oct 2023 16:31:46 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id CA8294EE0749; Tue, 24 Oct 2023 16:31:45 +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: 0f8711dd-727a-11ee-9b0e-b553b5be7939 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, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Nicola Vetrini , Wei Liu Subject: [RFC 3/4] x86/hvm: quirks: address MISRA C:2012 Rule 9.3 Date: Tue, 24 Oct 2023 16:31:37 +0200 Message-Id: <2ba4ba50b7460ff03f7c4e38aca17c9c24bcad39.1698155925.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: 1698157933598100004 Content-Type: text/plain; charset="utf-8" Partially explicitly initalized .matches arrays result in violations of Rule 9.3; this is resolved by using designated initializers, which is permitted by the Rule. Mechanical changes. Signed-off-by: Nicola Vetrini --- xen/arch/x86/hvm/quirks.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/xen/arch/x86/hvm/quirks.c b/xen/arch/x86/hvm/quirks.c index bd30b0f881cb..75c3fdc87749 100644 --- a/xen/arch/x86/hvm/quirks.c +++ b/xen/arch/x86/hvm/quirks.c @@ -37,40 +37,40 @@ static int __init cf_check check_port80(void) .callback =3D dmi_hvm_deny_port80, .ident =3D "Compaq Presario V6000", .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), - DMI_MATCH(DMI_BOARD_NAME, "30B7") + [0] =3D DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), + [1] =3D DMI_MATCH(DMI_BOARD_NAME, "30B7") } }, { .callback =3D dmi_hvm_deny_port80, .ident =3D "HP Pavilion dv9000z", .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), - DMI_MATCH(DMI_BOARD_NAME, "30B9") + [0] =3D DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), + [1] =3D DMI_MATCH(DMI_BOARD_NAME, "30B9") } }, { .callback =3D dmi_hvm_deny_port80, .ident =3D "HP Pavilion dv6000", .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), - DMI_MATCH(DMI_BOARD_NAME, "30B8") + [0] =3D DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), + [1] =3D DMI_MATCH(DMI_BOARD_NAME, "30B8") } }, { .callback =3D dmi_hvm_deny_port80, .ident =3D "HP Pavilion tx1000", .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), - DMI_MATCH(DMI_BOARD_NAME, "30BF") + [0] =3D DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), + [1] =3D DMI_MATCH(DMI_BOARD_NAME, "30BF") } }, { .callback =3D dmi_hvm_deny_port80, .ident =3D "Presario F700", .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), - DMI_MATCH(DMI_BOARD_NAME, "30D3") + [0] =3D DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), + [1] =3D DMI_MATCH(DMI_BOARD_NAME, "30D3") } }, { } --=20 2.34.1 From nobody Fri May 17 03:39:40 2024 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 169815793956957.29901312506945; Tue, 24 Oct 2023 07:32:19 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.622037.969158 (Exim 4.92) (envelope-from ) id 1qvIRm-0006qO-0z; Tue, 24 Oct 2023 14:31:54 +0000 Received: by outflank-mailman (output) from mailman id 622037.969158; Tue, 24 Oct 2023 14:31:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qvIRl-0006q9-TH; Tue, 24 Oct 2023 14:31:53 +0000 Received: by outflank-mailman (input) for mailman id 622037; Tue, 24 Oct 2023 14:31:51 +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 1qvIRj-0006O8-Fy for xen-devel@lists.xenproject.org; Tue, 24 Oct 2023 14:31:51 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 0ff47a84-727a-11ee-9b0e-b553b5be7939; Tue, 24 Oct 2023 16:31:47 +0200 (CEST) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id BE6584EE074A; Tue, 24 Oct 2023 16:31:46 +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: 0ff47a84-727a-11ee-9b0e-b553b5be7939 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, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Nicola Vetrini Subject: [RFC 4/4] amd/iommu: fully initialize array in 'flush_command_buffer' Date: Tue, 24 Oct 2023 16:31:38 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1698157941423100001 Content-Type: text/plain; charset="utf-8" Fully explicit initialization of the cmd array resolves a violation of MISRA C:2012 Rule 9.3. Signed-off-by: Nicola Vetrini Acked-by: Jan Beulich --- xen/drivers/passthrough/amd/iommu_cmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/amd/iommu_cmd.c b/xen/drivers/passthro= ugh/amd/iommu_cmd.c index cb28b36abc38..49b9fcac9410 100644 --- a/xen/drivers/passthrough/amd/iommu_cmd.c +++ b/xen/drivers/passthrough/amd/iommu_cmd.c @@ -66,7 +66,8 @@ static void flush_command_buffer(struct amd_iommu *iommu, IOMMU_COMP_WAIT_S_FLAG_MASK), (addr >> 32) | MASK_INSR(IOMMU_CMD_COMPLETION_WAIT, IOMMU_CMD_OPCODE_MASK), - CMD_COMPLETION_DONE + CMD_COMPLETION_DONE, + 0 }; s_time_t start, timeout; static unsigned int __read_mostly threshold =3D 1; -- 2.34.1