All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com,
	xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com,
	consulting@bugseng.com,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Julien Grall" <julien@xen.org>, "Wei Liu" <wl@xen.org>,
	"Bertrand Marquis" <bertrand.marquis@arm.com>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH 1/2] xen: apply deviation for Rule 8.4 (asm-only definitions)
Date: Mon, 04 Sep 2023 09:19:12 +0200	[thread overview]
Message-ID: <babbc14aff87b0d8546f4c617eccac3b@bugseng.com> (raw)
In-Reply-To: <efb3dfa7-0fd0-83a5-67dc-eafad0a2bb57@suse.com>

On 04/09/2023 09:02, Jan Beulich wrote:
> On 01.09.2023 18:34, Nicola Vetrini wrote:
>> As stated in 'docs/misra/rules.rst' the functions that are used only 
>> by
>> asm modules do not need to conform to MISRA C:2012 Rule 8.4.
>> The deviations are carried out with a SAF comment.
>> 
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> ---
>> Where the identifier for a function definition is on the next line 
>> w.r.t. the
>> return type, they have been put on the same line (e.g. efi_start) to 
>> avoid
>> stylistically questionable constructs, such as
>> 
>> int
>> /* SAF-1-safe */
>> func(void) {
>> 	...
>> }
> 
> And
> 
> /* SAF-1-safe */
> int
> func(void) {
> 
> is not an option?
> 

Not at the moment, as it would deviate the line with the return type and 
not the one below,
and this is not configurable in the scripts under 
xen/scripts/xen-analysis:

/* SAF-1-safe */ -> /* -E> safe ... 1 */
int                 int
func(void)          func(void)

As I said, this can perhaps be solved by allowing markers to specify 
either a row count, such as

/* SAF-1-safe 2 */ -> /* -E> safe ... 2 */
int                   int
func(void)            func(void)

or count the line span of the whole function declarator in the python 
script and translating
/* SAF-1-safe */ -> /* -E> safe ... 2 */.

> Further in the cover letter you say "Deviating variables needs more 
> care, and
> is therefore postponed to another patch", yet then here you annotate a 
> couple
> of variables as well. Could you clarify what the criteria are for 
> "needs more
> care"?
> 

I see. I did not intend for those changes to end up in this patch, 
although those two are
clearly only used by asm code and therefore are excepted.
Most of the variables I left out are also used by C code, therefore they 
may be eligible for
a declaration, but where to put this declaration requires a careful 
examination in my opinion.
They are not too many, tough.

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


  reply	other threads:[~2023-09-04  7:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-01 16:34 [XEN PATCH 0/2] xen: deviate asm-only definitions for Rule 8.4 Nicola Vetrini
2023-09-01 16:34 ` [XEN PATCH 1/2] xen: apply deviation for Rule 8.4 (asm-only definitions) Nicola Vetrini
2023-09-04  7:02   ` Jan Beulich
2023-09-04  7:19     ` Nicola Vetrini [this message]
2023-09-04  8:09       ` Jan Beulich
2023-09-06 15:22         ` Nicola Vetrini
2023-09-07  0:58       ` Stefano Stabellini
2023-09-01 16:34 ` [XEN PATCH 2/2] automation: execute SAF translation before the analysis with ECLAIR Nicola Vetrini
2023-09-07  0:59   ` Stefano Stabellini

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=babbc14aff87b0d8546f4c617eccac3b@bugseng.com \
    --to=nicola.vetrini@bugseng.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ayan.kumar.halder@amd.com \
    --cc=bertrand.marquis@arm.com \
    --cc=consulting@bugseng.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=xenia.ragiadakou@amd.com \
    /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.