Mailing List Archive

[XEN PATCH v2 1/2] xen/sched: address violations of MISRA C:2012 Rule 16.3
Add break statement to address a violation of MISRA C:2012 Rule 16.3
("An unconditional `break' statement shall terminate every
switch-clause").
Replace deprecated comment /* FALLTHRU */ with pseudo-keyword
fallthrough to meet the requirements to deviate the rule.

No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
Changes in v2:
- this patch is the result of merging together two different patches with the
same title;
- commit message has been improved to make clear that the comment is
deprecated.
---
xen/common/sched/core.c | 1 +
xen/common/sched/credit2.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 3e48da1cdd..0cb33831d2 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -2007,6 +2007,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)

default:
ret = -ENOSYS;
+ break;
}

return ret;
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index c76330d79d..0962b52415 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3152,8 +3152,8 @@ static int cf_check csched2_sys_cntl(
printk(XENLOG_INFO "Disabling context switch rate limiting\n");
prv->ratelimit_us = params->ratelimit_us;
write_unlock_irqrestore(&prv->lock, flags);
+ fallthrough;

- /* FALLTHRU */
case XEN_SYSCTL_SCHEDOP_getinfo:
params->ratelimit_us = prv->ratelimit_us;
break;
--
2.34.1
Re: [XEN PATCH v2 1/2] xen/sched: address violations of MISRA C:2012 Rule 16.3 [ In reply to ]
On 04.04.2024 09:49, Federico Serafini wrote:
> Add break statement to address a violation of MISRA C:2012 Rule 16.3
> ("An unconditional `break' statement shall terminate every
> switch-clause").
> Replace deprecated comment /* FALLTHRU */ with pseudo-keyword
> fallthrough to meet the requirements to deviate the rule.
>
> No functional change.
>
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
Re: [XEN PATCH v2 1/2] xen/sched: address violations of MISRA C:2012 Rule 16.3 [ In reply to ]
On Thu, Apr 4, 2024 at 8:49?AM Federico Serafini
<federico.serafini@bugseng.com> wrote:
>
> Add break statement to address a violation of MISRA C:2012 Rule 16.3
> ("An unconditional `break' statement shall terminate every
> switch-clause").
> Replace deprecated comment /* FALLTHRU */ with pseudo-keyword
> fallthrough to meet the requirements to deviate the rule.
>
> No functional change.
>
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Acked-by: George Dunlap <george.dunlap@cloud.com>