Message ID | 47eb1f8316672af172d9c34bfa6e7dda6bd7ce37.1710403601.git.federico.serafini@bugseng.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [XEN] perfc: add pseudo-keyword fallthrough | expand |
On 14.03.2024 13:25, Federico Serafini wrote: > Add pseudo-keyword fallthrough to make explicit the intention of the > code and meet requirements to deviate MISRA C:2012 Rule 16.3 > ("An unconditional `break' statement shall terminate every > switch-clause"). > > No functional change. > > Signed-off-by: Federico Serafini <federico.serafini@bugseng.com> Acked-by: Jan Beulich <jbeulich@suse.com>
diff --git a/xen/common/perfc.c b/xen/common/perfc.c index 7400667bf0..80480aa776 100644 --- a/xen/common/perfc.c +++ b/xen/common/perfc.c @@ -134,6 +134,7 @@ void cf_check perfc_reset(unsigned char key) case TYPE_SINGLE: for_each_online_cpu ( cpu ) per_cpu(perfcounters, cpu)[j] = 0; + fallthrough; case TYPE_S_SINGLE: ++j; break; @@ -141,6 +142,7 @@ void cf_check perfc_reset(unsigned char key) for_each_online_cpu ( cpu ) memset(per_cpu(perfcounters, cpu) + j, 0, perfc_info[i].nr_elements * sizeof(perfc_t)); + fallthrough; case TYPE_S_ARRAY: j += perfc_info[i].nr_elements; break;
Add pseudo-keyword fallthrough to make explicit the intention of the code and meet requirements to deviate MISRA C:2012 Rule 16.3 ("An unconditional `break' statement shall terminate every switch-clause"). No functional change. Signed-off-by: Federico Serafini <federico.serafini@bugseng.com> --- xen/common/perfc.c | 2 ++ 1 file changed, 2 insertions(+)