[PATCH 0/3] xen-analysis.py: Enable Xen deviation tag at the end of the line

Luca Fancellu posted 3 patches 2 months, 4 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20240131110241.3951995-1-luca.fancellu@arm.com
docs/misra/documenting-violations.rst         | 10 ++++
xen/scripts/xen_analysis/cppcheck_analysis.py |  4 +-
xen/scripts/xen_analysis/generic_analysis.py  | 14 +++--
xen/scripts/xen_analysis/tag_database.py      | 59 ++++++++++++++-----
xen/scripts/xen_analysis/utils.py             |  2 +-
5 files changed, 67 insertions(+), 22 deletions(-)
[PATCH 0/3] xen-analysis.py: Enable Xen deviation tag at the end of the line
Posted by Luca Fancellu 2 months, 4 weeks ago
This serie is enabling the xen-analysis tool to parse and substitute correctly
a deviation tag put at the end of the line containing a deviation to be deviated.

Before this serie the only way to deviate a violation was to put the tag in the
line above:

/* SAF-<id>-safe deviate the bla bla bla */
<line containing the violation>

But there are places in the code base where using the tag in the line above is
not convinient, for example:

if ( (expression) &&
     ((expression with violation) ||
     (expression) )
{
  [...]
}

In the above example is better to have the suppression comment at the end of the
line:

if ( (expression) &&
     ((expression with violation) || /* SAF-<id>-safe deviate the bla bla bla */
     (expression) )
{
  [...]
}

This clearly brings up the question about the code style line length, which in
this case needs to be amended for Xen deviation tags that goes above the limit.

Luca Fancellu (3):
  xen-analysis.py: Use named group for tag regex
  xen-analysis.py: Substitute only the comment instead of the line
  xen-analysis.py: Accept deviation comment at the end of the line

 docs/misra/documenting-violations.rst         | 10 ++++
 xen/scripts/xen_analysis/cppcheck_analysis.py |  4 +-
 xen/scripts/xen_analysis/generic_analysis.py  | 14 +++--
 xen/scripts/xen_analysis/tag_database.py      | 59 ++++++++++++++-----
 xen/scripts/xen_analysis/utils.py             |  2 +-
 5 files changed, 67 insertions(+), 22 deletions(-)

-- 
2.34.1
Re: [PATCH 0/3] xen-analysis.py: Enable Xen deviation tag at the end of the line
Posted by Stefano Stabellini 2 months, 2 weeks ago
On Wed, 31 Jan 2024, Luca Fancellu wrote:
> This serie is enabling the xen-analysis tool to parse and substitute correctly
> a deviation tag put at the end of the line containing a deviation to be deviated.
> 
> Before this serie the only way to deviate a violation was to put the tag in the
> line above:
> 
> /* SAF-<id>-safe deviate the bla bla bla */
> <line containing the violation>
> 
> But there are places in the code base where using the tag in the line above is
> not convinient, for example:
> 
> if ( (expression) &&
>      ((expression with violation) ||
>      (expression) )
> {
>   [...]
> }
> 
> In the above example is better to have the suppression comment at the end of the
> line:
> 
> if ( (expression) &&
>      ((expression with violation) || /* SAF-<id>-safe deviate the bla bla bla */
>      (expression) )
> {
>   [...]
> }
> 
> This clearly brings up the question about the code style line length, which in
> this case needs to be amended for Xen deviation tags that goes above the limit.


Hi Luca,

I tested the series in a number of configurations and everything works
as expected. Great!

For the whole series:

Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Re: [PATCH 0/3] xen-analysis.py: Enable Xen deviation tag at the end of the line
Posted by Julien Grall 2 months, 1 week ago
Hi Stefano,

On 15/02/2024 01:08, Stefano Stabellini wrote:
> On Wed, 31 Jan 2024, Luca Fancellu wrote:
>> This serie is enabling the xen-analysis tool to parse and substitute correctly
>> a deviation tag put at the end of the line containing a deviation to be deviated.
>>
>> Before this serie the only way to deviate a violation was to put the tag in the
>> line above:
>>
>> /* SAF-<id>-safe deviate the bla bla bla */
>> <line containing the violation>
>>
>> But there are places in the code base where using the tag in the line above is
>> not convinient, for example:
>>
>> if ( (expression) &&
>>       ((expression with violation) ||
>>       (expression) )
>> {
>>    [...]
>> }
>>
>> In the above example is better to have the suppression comment at the end of the
>> line:
>>
>> if ( (expression) &&
>>       ((expression with violation) || /* SAF-<id>-safe deviate the bla bla bla */
>>       (expression) )
>> {
>>    [...]
>> }
>>
>> This clearly brings up the question about the code style line length, which in
>> this case needs to be amended for Xen deviation tags that goes above the limit.
> 
> 
> Hi Luca,
> 
> I tested the series in a number of configurations and everything works
> as expected. Great!
> 
> For the whole series:
> 
> Acked-by: Stefano Stabellini <sstabellini@kernel.org>

This is now committed.

Cheers,


-- 
Julien Grall