From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Teddy Astie" <teddy.astie@vates.tech>,
"Roger Pau Monné" <roger@xenproject.org>
Subject: Re: [PATCH 01/12] x86/IO-APIC: address Misra 2.1 rule violations
Date: Fri, 28 Aug 2026 10:31:56 +0200 [thread overview]
Message-ID: <32044eb1dfef2d0281e11534a6d1d938@bugseng.com> (raw)
In-Reply-To: <85c111a5-105c-4b8f-8b81-d7ec1d0f9436@suse.com>
On 2026-08-28 08:59, Jan Beulich wrote:
> In both functions cases 0..3 are handled, and a 2-bit mask is applied
> to
> the switch() expression. Therefore the default: cases are reported
> unreachable by Eclair. Subsume the "case 2" blocks each into the
> corresponding default ones.
>
> While there also drop all the pointless figure braces inside the
> various
> case blocks, inserting blank lines instead between them.
>
> No functional change.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> --- a/xen/arch/x86/io_apic.c
> +++ b/xen/arch/x86/io_apic.c
> @@ -804,66 +804,48 @@ static int __init MPBIOS_polarity(int id
> switch (mp_irqs[idx].mpc_irqflag & 3)
> {
> case 0: /* conforms, ie. bus-type dependent polarity */
> - {
> switch (mp_bus_id_to_type[bus])
> {
> case MP_BUS_ISA: /* ISA pin */
> - {
> polarity = default_ISA_polarity(idx);
> break;
> - }
> +
> case MP_BUS_EISA: /* EISA pin */
> - {
> polarity = default_EISA_polarity(idx);
> break;
> - }
> +
> case MP_BUS_PCI: /* PCI pin */
> - {
> polarity = default_PCI_polarity(idx);
> break;
> - }
> +
> case MP_BUS_MCA: /* MCA pin */
> - {
> polarity = default_MCA_polarity(idx);
> break;
> - }
> +
> case MP_BUS_NEC98: /* NEC 98 pin */
> - {
> polarity = default_NEC98_polarity(idx);
> break;
> - }
> +
> default:
> - {
> printk(KERN_WARNING "broken BIOS!!\n");
> polarity = 1;
> break;
> }
> - }
> break;
> - }
> +
> case 1: /* high active */
> - {
> polarity = 0;
> break;
> - }
> - case 2: /* reserved */
> - {
> - printk(KERN_WARNING "broken BIOS!!\n");
> - polarity = 1;
> - break;
> - }
> +
> case 3: /* low active */
> - {
> polarity = 1;
> break;
> - }
> - default: /* invalid */
> - {
> +
> + default: /* reserved */
> printk(KERN_WARNING "broken BIOS!!\n");
> polarity = 1;
> break;
> }
> - }
> return polarity;
> }
>
> @@ -878,66 +860,48 @@ static int MPBIOS_trigger(int idx)
> switch ((mp_irqs[idx].mpc_irqflag>>2) & 3)
> {
> case 0: /* conforms, ie. bus-type dependent */
> - {
> switch (mp_bus_id_to_type[bus])
> {
> case MP_BUS_ISA: /* ISA pin */
> - {
> trigger = default_ISA_trigger(idx);
> break;
> - }
> +
> case MP_BUS_EISA: /* EISA pin */
> - {
> trigger = default_EISA_trigger(idx);
> break;
> - }
> +
> case MP_BUS_PCI: /* PCI pin */
> - {
> trigger = default_PCI_trigger(idx);
> break;
> - }
> +
> case MP_BUS_MCA: /* MCA pin */
> - {
> trigger = default_MCA_trigger(idx);
> break;
> - }
> +
> case MP_BUS_NEC98: /* NEC 98 pin */
> - {
> trigger = default_NEC98_trigger(idx);
> break;
> - }
> +
> default:
> - {
> printk(KERN_WARNING "broken BIOS!!\n");
> trigger = 1;
> break;
> }
> - }
> break;
> - }
> +
> case 1: /* edge */
> - {
> trigger = 0;
> break;
> - }
> - case 2: /* reserved */
> - {
> - printk(KERN_WARNING "broken BIOS!!\n");
> - trigger = 1;
> - break;
> - }
> +
> case 3: /* level */
> - {
> trigger = 1;
> break;
> - }
> - default: /* invalid */
> - {
> +
> + default: /* reserved */
> printk(KERN_WARNING "broken BIOS!!\n");
> trigger = 0;
> break;
> }
> - }
> return trigger;
> }
--
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253
next prev parent reply other threads:[~2026-08-28 8:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 6:58 [PATCH 00/12] address most remaining Misra rule 2.1 violations Jan Beulich
2026-08-28 6:59 ` [PATCH 01/12] x86/IO-APIC: address Misra 2.1 rule violations Jan Beulich
2026-08-28 8:31 ` Nicola Vetrini [this message]
2026-08-28 7:00 ` [PATCH 02/12] x86/mm: pagetable_dying() is HVM+SHADOW_PAGING only Jan Beulich
2026-08-28 7:00 ` [PATCH 03/12] x86/shadow: eliminate unused forms of sh_map_and_validate_gl<N>e() Jan Beulich
2026-08-28 7:01 ` [PATCH 04/12] x86: add noreturn in a few more places Jan Beulich
2026-08-28 7:02 ` [PATCH 05/12] x86/crash: address Misra 2.1 rule violation Jan Beulich
2026-08-28 7:02 ` [PATCH 06/12] kexec: machine_reboot_kexec() doesn't return Jan Beulich
2026-08-28 9:55 ` Nicola Vetrini
2026-08-28 7:03 ` [PATCH 07/12] altp2m: address Misra 2.1 rule violation Jan Beulich
2026-08-28 7:04 ` [PATCH 08/12] Arm/GIC: add noreturn in a few more places Jan Beulich
2026-08-28 7:04 ` [PATCH 09/12] Eclair: deviate BUILD_ERROR() wrt rule 2.1 and introduce variants Jan Beulich
2026-08-28 7:05 ` [PATCH 10/12] PCI/physdev: address Misra 2.1 rule violation Jan Beulich
2026-08-28 7:05 ` [PATCH 11/12] x86/HVM: address Misra 2.1 rule violations Jan Beulich
2026-08-28 7:06 ` [PATCH 12/12] x86/nSVM: address Misra 2.1 rule violation Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=32044eb1dfef2d0281e11534a6d1d938@bugseng.com \
--to=nicola.vetrini@bugseng.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=roger@xenproject.org \
--cc=teddy.astie@vates.tech \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.