[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen: Add MISRA support to cppcheck make rule


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Tue, 31 May 2022 14:14:10 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XxHEcgMM49qBHPljpDfj5LGFJA9osm1VHxdl5+Cmsb8=; b=lotoNgrF8JD0hA6fkkhny8QGCNl51XceVoRdrG2AWFzGbaQQN2PPs+HKYEm43SYk6m2U45FmP6OTmB7t1e8THsDY/egw3h7ORGaNeedgEz2N8bgc+Ct0mzoBLKIvEMZkeE0GUch7/GClcKrNKVRJ3LxacaKwEkBMi4w9aK5JnqU/FSdAnW857YHD+Oc2mUTPxu/hzmS6eMOskvJ8Fp5tKpdtls3TPEB+21NQ9k1wT823B2ITYbL/U2vcLEROTzInhTlBqxDine+hdLLnYfiJgexUA8T/56sw6fJVU0VK1cKisuH+1RLmXg6MaI0bgYXnQGVyMnt4r9G4cL7SVcXp5g==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XxHEcgMM49qBHPljpDfj5LGFJA9osm1VHxdl5+Cmsb8=; b=WWtRE7PZ3FpbMERuqxlcu25D/uNLxHrVJanriJMCytwAhhHhTmp1nHWkHa5MHnfRXT1YFQ4VSuisFH8raZgb5lfbwJPLQnoiKSgwWEizm1JxkjcQE4bJrOwIPd2rirHvM7xyd3fUNedI7HrrWX31GwwuiBZi9WQjRCRZfPErlhDTQT6Y99kboqUBuzhQFVJnIZB90haxUJ3q726Z8LwNSLBzjip1SqKgMt+DT5lujBuDtDztUrNgi5XLEEDhR1/4Yom9kEKUmADoIOsV6eYU3fU+nnKW4lH6nQhWETV/9/5WKmJ9APpXqsQRHUt6Y4OSLK3zUmfkpS1sWbEJdSUT2A==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=LPgRh4zBhc8MZ1M1wpJgcdi7hhM5fDFu1oaGkBvmpOglVlE0cSjHvd91Qv9zTAqOdS2SjXtjHwuMLEWYzfq/E1D7eiHHcv5/kQu8rmIWwsradcSwtnAbQ1xGJSdnE62wuMcWTojlrnV4GTn1sqnsVT8tkRTV5/9lGp1DqQMhOujtRToG6fq6Fdx6fBpjdGrPpCVt3cHPyWYaPzggxpXokLqpSdbevPQ1n40matwojlNadGKgYOdQYqJaHI7Us8WgsuU2VMXTW4NWyspxZjQCdgilH1XREhUOIs9UakT/g7Ru4e/6Hqt34GaagJSqzBVfXpJtO3B583+6duBoYNLJ6A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P1cs0bA1goyIJ16z+BO58BZGZ/qxQqppKLo9GiUiTJho2BfbwZF20K/JUwjRAutFipZvGXjB+WFAEoSLxdS7229jQ3Lm4VF5A+WdqoiVX3Piw0CmLtKMduTufYB0wqX9yPmlFC14UlTg2DTgOjLnPpUJprdZCet0+/NU0BFbBB+ydP6AoPMsAlLyT/kxHXgsGNkngwVZhIwLP8Sgnv5aySPVkkbZjkybUBdQJPoK5/7E3GHB9TaR50j2Q54Mw1gqDrpzDdaszkXn8FZoWWBi7OmvKGuPcrS832oGjn/mqlkrSfZejKjCsYAMCmnfi5es05N61EC8wXDeJmnyYtoeMA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 31 May 2022 14:14:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYdPKgb8OwohyX90ebe0mOYdpVU605ANEAgAAGrYA=
  • Thread-topic: [PATCH] xen: Add MISRA support to cppcheck make rule

Hi Jan,

> On 31 May 2022, at 14:50, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 31.05.2022 15:30, Bertrand Marquis wrote:
>> --- a/.gitignore
>> +++ b/.gitignore
>> @@ -297,6 +297,8 @@ xen/.banner
>> xen/.config
>> xen/.config.old
>> xen/.xen.elf32
>> +xen/cppcheck-misra.txt
>> +xen/cppcheck-misra.json
>> xen/xen-cppcheck.xml
>> xen/System.map
>> xen/arch/x86/boot/mkelf32
> 
> Please can you obey to sorting here, inserting next to
> xen/cppcheck-htmlreport? Seeing that xen/xen-cppcheck.xml was added
> here by you at the same time as xen/cppcheck-htmlreport, may I further
> ask that you move that line to where it belongs as well?

Sure will do.

> 
> Additionally I wonder if you couldn't use just one line, specifying
> xen/cppcheck-misra.* ; this could then also hold for the _clean rule
> addition further down in the patch.

Ok.

> 
>> @@ -703,6 +716,21 @@ cppcheck-version:
>>              exit 1; \
>>      fi
>> 
>> +# List of Misra rules to respect is written inside a doc.
>> +# In order to have some helpful text in the cppcheck output, generate a text
>> +# file containing the rules identifier, classification and text from the Xen
>> +# documentation file. Also generate a json file with the right arguments for
>> +# cppcheck in json format including the list of rules to ignore
> 
> Nit: Missing full stop at the end.

Will fix

> 
>> +# Replace current by goal in the dependency to generate an analysis for all
>> +# rules we would like to respect.
>> +cppcheck-misra.json cppcheck-misra.txt: $(XEN_ROOT)/docs/misra/rules.rst
>> +    $(Q)$(srctree)/tools/convert_misra_doc.py -i $< -o cppcheck-misra.txt \
>> +            -j cppcheck-misra.json
>> +
>> +# Prevent parallel make issues as script is generating both files
>> +cppcheck-misra.json: cppcheck-misra.txt
> 
> With this dependency the earlier rule should not list multiple targets
> (and it generally should not, for not being a pattern rule). If I'm not
> mistaken the way you have it the Python script would be invoked twice,
> and all you prevent is that it is invoked twice in parallel. And then
> please use $@ inside the rule. Additionally, with the script being an
> in-tree one, the rule should also have a dependency on that script
> (such that the targets would be rebuilt if the script alone changes).

I am a bit lost on the $@, previous patch adding cppcheck was changed
to use $(Q) instead. So can you justify this request ?

For the rest, thanks for the finding, I agree and will fix.

Cheers
Bertrand

> 
> Jan
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.