From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Federico Serafini <federico.serafini@bugseng.com>,
Stefano Stabellini <stefano.stabellini@amd.com>,
consulting@bugseng.com, George Dunlap <george.dunlap@citrix.com>,
xen-devel@lists.xenproject.org,
Dario Faggioli <dfaggioli@suse.com>
Subject: Re: [XEN PATCH 3/7] xen/sched: address a violation of MISRA C:2012 Rule 16.3
Date: Wed, 03 Apr 2024 09:52:10 +0200 [thread overview]
Message-ID: <0d0c8cd162a8bfed07dd374ef2dd62d4@bugseng.com> (raw)
In-Reply-To: <28786c5b-c625-4754-980d-c9a0fdc49c37@suse.com>
On 2024-04-03 08:33, Jan Beulich wrote:
> On 02.04.2024 09:22, Federico Serafini wrote:
>> Use pseudo-keyword fallthrough to meet the 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/sched/credit2.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> 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;
>
> Hmm, the description doesn't say what's wrong with the comment.
> Furthermore
> docs/misra/rules.rst doesn't mention "fallthrough" at all, nor the
> alternative of using comments. I notice docs/misra/deviations.rst does,
> and
> there the specific comment used here isn't covered. That would want
> saying
> in the description.
>
> Stefano (and others) - in this context it becomes noticeable that
> having
> stuff scattered across multiple doc files isn't necessarily helpful.
> Other
> permissible keywords are mentioned in rules.rst. The pseudo-keyword
> "fallthrough" as well as comments are mentioned on deviations.rst.
> Could
> you remind me of the reason(s) why things aren't recorded in a single,
> central place?
>
> Jan
If I recall correctly, the idea was to avoid rules.rst from getting too
long and too specific about which patterns were deviated, while also
having a precise record of the MISRA deviations that didn't live in
ECLAIR-specific files. Maybe the use of the pseudo-keyword emerged after
the rule was added to rules.rst, since deviations.rst is updated more
frequently.
--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)
next prev parent reply other threads:[~2024-04-03 7:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-02 7:22 [XEN PATCH 0/7] xen: address violations of MISRA C:2012 Rule 16.3 Federico Serafini
2024-04-02 7:22 ` [XEN PATCH 1/7] xen/domctl: address a violation " Federico Serafini
2024-04-03 6:23 ` Jan Beulich
2024-04-02 7:22 ` [XEN PATCH 2/7] console: " Federico Serafini
2024-04-03 6:24 ` Jan Beulich
2024-04-02 7:22 ` [XEN PATCH 3/7] xen/sched: " Federico Serafini
2024-04-03 6:33 ` Jan Beulich
2024-04-03 7:52 ` Nicola Vetrini [this message]
2024-04-05 0:18 ` Stefano Stabellini
2024-04-05 6:43 ` Jan Beulich
2024-04-05 19:26 ` Stefano Stabellini
2024-04-02 7:22 ` [XEN PATCH 4/7] xen/evtchn: " Federico Serafini
2024-04-03 6:53 ` Jan Beulich
2024-04-02 7:22 ` [XEN PATCH 5/7] xen/sched: " Federico Serafini
2024-04-03 6:55 ` Jan Beulich
2024-04-03 7:36 ` Federico Serafini
2024-04-02 7:22 ` [XEN PATCH 6/7] xen/vm-event: " Federico Serafini
2024-04-02 23:31 ` Tamas K Lengyel
2024-04-02 7:22 ` [XEN PATCH 7/7] vsprintf: address violations " Federico Serafini
2024-04-03 7:06 ` Jan Beulich
2024-04-03 7:38 ` Federico Serafini
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=0d0c8cd162a8bfed07dd374ef2dd62d4@bugseng.com \
--to=nicola.vetrini@bugseng.com \
--cc=consulting@bugseng.com \
--cc=dfaggioli@suse.com \
--cc=federico.serafini@bugseng.com \
--cc=george.dunlap@citrix.com \
--cc=jbeulich@suse.com \
--cc=stefano.stabellini@amd.com \
--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.