[XEN PATCH 3/3] automation/eclair: build docs/misra to address MISRA C:2012 Dir 4.1

Nicola Vetrini posted 3 patches 2 years, 5 months ago
There is a newer version of this series
[XEN PATCH 3/3] automation/eclair: build docs/misra to address MISRA C:2012 Dir 4.1
Posted by Nicola Vetrini 2 years, 5 months ago
The documentation pertaining Directive 4.1 is contained in docs/misra.
The build script driving the analysis is amended to allow ECLAIR to
analyze such file.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 automation/eclair_analysis/build.sh   | 11 ++++++++---
 automation/eclair_analysis/prepare.sh |  5 +++--
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/automation/eclair_analysis/build.sh b/automation/eclair_analysis/build.sh
index ec087dd822fa..556ed698bf8b 100755
--- a/automation/eclair_analysis/build.sh
+++ b/automation/eclair_analysis/build.sh
@@ -34,11 +34,16 @@ else
 fi
 
 (
-  cd xen
-
   make "-j${PROCESSORS}" "-l${PROCESSORS}.0"    \
        "CROSS_COMPILE=${CROSS_COMPILE}"         \
        "CC=${CROSS_COMPILE}gcc-12"              \
        "CXX=${CROSS_COMPILE}g++-12"             \
-       "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"
+       "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"     \
+       -C docs misra
+  make "-j${PROCESSORS}" "-l${PROCESSORS}.0"    \
+       "CROSS_COMPILE=${CROSS_COMPILE}"         \
+       "CC=${CROSS_COMPILE}gcc-12"              \
+       "CXX=${CROSS_COMPILE}g++-12"             \
+       "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"     \
+			 -C xen
 )
diff --git a/automation/eclair_analysis/prepare.sh b/automation/eclair_analysis/prepare.sh
index 275a1a3f517c..452e309b658b 100755
--- a/automation/eclair_analysis/prepare.sh
+++ b/automation/eclair_analysis/prepare.sh
@@ -35,8 +35,9 @@ else
 fi
 
 (
-    cd xen
-    cp "${CONFIG_FILE}" .config
+    ./configure
+    cp "${CONFIG_FILE}" xen/.config
     make clean
+    cd xen
     make -f ${script_dir}/Makefile.prepare prepare
 )
-- 
2.34.1
Re: [XEN PATCH 3/3] automation/eclair: build docs/misra to address MISRA C:2012 Dir 4.1
Posted by Stefano Stabellini 2 years, 5 months ago
On Fri, 1 Sep 2023, Nicola Vetrini wrote:
> The documentation pertaining Directive 4.1 is contained in docs/misra.
> The build script driving the analysis is amended to allow ECLAIR to
> analyze such file.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
>  automation/eclair_analysis/build.sh   | 11 ++++++++---
>  automation/eclair_analysis/prepare.sh |  5 +++--
>  2 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/automation/eclair_analysis/build.sh b/automation/eclair_analysis/build.sh
> index ec087dd822fa..556ed698bf8b 100755
> --- a/automation/eclair_analysis/build.sh
> +++ b/automation/eclair_analysis/build.sh
> @@ -34,11 +34,16 @@ else
>  fi
>  
>  (
> -  cd xen
> -
>    make "-j${PROCESSORS}" "-l${PROCESSORS}.0"    \
>         "CROSS_COMPILE=${CROSS_COMPILE}"         \
>         "CC=${CROSS_COMPILE}gcc-12"              \
>         "CXX=${CROSS_COMPILE}g++-12"             \
> -       "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"
> +       "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"     \
> +       -C docs misra

I don't think you need all these options to generate docs and misra.
Probably it would be sufficient just make -C docs misra

However given that they are not harmful:

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> +  make "-j${PROCESSORS}" "-l${PROCESSORS}.0"    \
> +       "CROSS_COMPILE=${CROSS_COMPILE}"         \
> +       "CC=${CROSS_COMPILE}gcc-12"              \
> +       "CXX=${CROSS_COMPILE}g++-12"             \
> +       "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"     \
> +			 -C xen
>  )
> diff --git a/automation/eclair_analysis/prepare.sh b/automation/eclair_analysis/prepare.sh
> index 275a1a3f517c..452e309b658b 100755
> --- a/automation/eclair_analysis/prepare.sh
> +++ b/automation/eclair_analysis/prepare.sh
> @@ -35,8 +35,9 @@ else
>  fi
>  
>  (
> -    cd xen
> -    cp "${CONFIG_FILE}" .config
> +    ./configure
> +    cp "${CONFIG_FILE}" xen/.config
>      make clean
> +    cd xen
>      make -f ${script_dir}/Makefile.prepare prepare
>  )
> -- 
> 2.34.1
>
Re: [XEN PATCH 3/3] automation/eclair: build docs/misra to address MISRA C:2012 Dir 4.1
Posted by Nicola Vetrini 2 years, 5 months ago
On 08/09/2023 02:25, Stefano Stabellini wrote:
> On Fri, 1 Sep 2023, Nicola Vetrini wrote:
>> The documentation pertaining Directive 4.1 is contained in docs/misra.
>> The build script driving the analysis is amended to allow ECLAIR to
>> analyze such file.
>> 
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> ---
>>  automation/eclair_analysis/build.sh   | 11 ++++++++---
>>  automation/eclair_analysis/prepare.sh |  5 +++--
>>  2 files changed, 11 insertions(+), 5 deletions(-)
>> 
>> diff --git a/automation/eclair_analysis/build.sh 
>> b/automation/eclair_analysis/build.sh
>> index ec087dd822fa..556ed698bf8b 100755
>> --- a/automation/eclair_analysis/build.sh
>> +++ b/automation/eclair_analysis/build.sh
>> @@ -34,11 +34,16 @@ else
>>  fi
>> 
>>  (
>> -  cd xen
>> -
>>    make "-j${PROCESSORS}" "-l${PROCESSORS}.0"    \
>>         "CROSS_COMPILE=${CROSS_COMPILE}"         \
>>         "CC=${CROSS_COMPILE}gcc-12"              \
>>         "CXX=${CROSS_COMPILE}g++-12"             \
>> -       "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"
>> +       "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"     \
>> +       -C docs misra
> 
> I don't think you need all these options to generate docs and misra.
> Probably it would be sufficient just make -C docs misra
> 
> However given that they are not harmful:
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> 

Ok, I'll try it out for the next version, otherwise I'll revert to this 
invocation.

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