diff mbox series

[XEN,v3,08/12] x86/vpt: address a violation of MISRA C Rule 16.3

Message ID 453ef39f5a2a1871d8b0c74d921ed6a413b179b4.1719383180.git.federico.serafini@bugseng.com (mailing list archive)
State Superseded
Headers show
Series x86: address some violations of MISRA C Rule 16.3 | expand

Commit Message

Federico Serafini June 26, 2024, 9:28 a.m. UTC
Add pseudo keyword fallthrough to meet the requirements to deviate
a violation of MISRA C Rule 16.3 ("An unconditional `break'
statement shall terminate every switch-clause").

No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
Changes in v3:
- better indentation of fallthrough.
---
 xen/arch/x86/hvm/vpt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Stefano Stabellini June 27, 2024, 12:55 a.m. UTC | #1
On Wed, 26 Jun 2024, Federico Serafini wrote:
> Add pseudo keyword fallthrough to meet the requirements to deviate
> a violation of MISRA C Rule 16.3 ("An unconditional `break'
> statement shall terminate every switch-clause").
> 
> No functional change.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Jan Beulich July 1, 2024, 8:49 a.m. UTC | #2
On 26.06.2024 11:28, Federico Serafini wrote:
> --- a/xen/arch/x86/hvm/vpt.c
> +++ b/xen/arch/x86/hvm/vpt.c
> @@ -118,9 +118,11 @@ static int pt_irq_masked(struct periodic_time *pt)
>              return 0;
>  
>          gsi = hvm_isa_irq_to_gsi(pt->irq);
> +
> +        /* Fallthrough to check if the interrupt is masked on the IO APIC. */
> +        fallthrough;
>      }
>  
> -    /* Fallthrough to check if the interrupt is masked on the IO APIC. */
>      case PTSRC_ioapic:
>      {
>          int mask = vioapic_get_mask(v->domain, gsi);

See question on patch 7. Plus the blank line may want purging here along
with the comment, to be consistent with what you're doing elsewhere.

Jan
Federico Serafini July 2, 2024, 7:58 a.m. UTC | #3
On 01/07/24 10:49, Jan Beulich wrote:
> On 26.06.2024 11:28, Federico Serafini wrote:
>> --- a/xen/arch/x86/hvm/vpt.c
>> +++ b/xen/arch/x86/hvm/vpt.c
>> @@ -118,9 +118,11 @@ static int pt_irq_masked(struct periodic_time *pt)
>>               return 0;
>>   
>>           gsi = hvm_isa_irq_to_gsi(pt->irq);
>> +
>> +        /* Fallthrough to check if the interrupt is masked on the IO APIC. */
>> +        fallthrough;
>>       }
>>   
>> -    /* Fallthrough to check if the interrupt is masked on the IO APIC. */
>>       case PTSRC_ioapic:
>>       {
>>           int mask = vioapic_get_mask(v->domain, gsi);
> 
> See question on patch 7. Plus the blank line may want purging here along
> with the comment, to be consistent with what you're doing elsewhere.

When in doubt, I think it is better to clarify rather than not,
however, if no one has anything to say, I will follow your instruction.

--
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)
diff mbox series

Patch

diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index e1d6845a28..ab06bea33e 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -118,9 +118,11 @@  static int pt_irq_masked(struct periodic_time *pt)
             return 0;
 
         gsi = hvm_isa_irq_to_gsi(pt->irq);
+
+        /* Fallthrough to check if the interrupt is masked on the IO APIC. */
+        fallthrough;
     }
 
-    /* Fallthrough to check if the interrupt is masked on the IO APIC. */
     case PTSRC_ioapic:
     {
         int mask = vioapic_get_mask(v->domain, gsi);