[PATCH] xen/common: device_tree: Fix MISRA C 2012 Rule 8.7 violation

Xenia Ragiadakou posted 1 patch 1 year, 11 months ago
Test gitlab-ci failed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20220622151557.545880-1-burzalodowa@gmail.com
xen/common/device_tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] xen/common: device_tree: Fix MISRA C 2012 Rule 8.7 violation
Posted by Xenia Ragiadakou 1 year, 11 months ago
The function __dt_n_size_cells() is referenced only in device_tree.c.
Change the linkage of the function from external to internal by adding
the storage-class specifier static to the function definition.

This patch aims to resolve indirectly a MISRA C 2012 Rule 8.4 violation
warning.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
---
 xen/common/device_tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 0e8798bd24..6c9712ab7b 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -496,7 +496,7 @@ static int __dt_n_addr_cells(const struct dt_device_node *np, bool_t parent)
     return DT_ROOT_NODE_ADDR_CELLS_DEFAULT;
 }
 
-int __dt_n_size_cells(const struct dt_device_node *np, bool_t parent)
+static int __dt_n_size_cells(const struct dt_device_node *np, bool_t parent)
 {
     const __be32 *ip;
 
-- 
2.34.1
Re: [PATCH] xen/common: device_tree: Fix MISRA C 2012 Rule 8.7 violation
Posted by Stefano Stabellini 1 year, 11 months ago
On Wed, 22 Jun 2022, Xenia Ragiadakou wrote:
> The function __dt_n_size_cells() is referenced only in device_tree.c.
> Change the linkage of the function from external to internal by adding
> the storage-class specifier static to the function definition.
> 
> This patch aims to resolve indirectly a MISRA C 2012 Rule 8.4 violation
> warning.
> 
> Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>

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


> ---
>  xen/common/device_tree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 0e8798bd24..6c9712ab7b 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -496,7 +496,7 @@ static int __dt_n_addr_cells(const struct dt_device_node *np, bool_t parent)
>      return DT_ROOT_NODE_ADDR_CELLS_DEFAULT;
>  }
>  
> -int __dt_n_size_cells(const struct dt_device_node *np, bool_t parent)
> +static int __dt_n_size_cells(const struct dt_device_node *np, bool_t parent)
>  {
>      const __be32 *ip;
>  
> -- 
> 2.34.1
>
Re: [PATCH] xen/common: device_tree: Fix MISRA C 2012 Rule 8.7 violation
Posted by Julien Grall 1 year, 10 months ago
Hi,

On 22/06/2022 20:31, Stefano Stabellini wrote:
> On Wed, 22 Jun 2022, Xenia Ragiadakou wrote:
>> The function __dt_n_size_cells() is referenced only in device_tree.c.
>> Change the linkage of the function from external to internal by adding
>> the storage-class specifier static to the function definition.
>>
>> This patch aims to resolve indirectly a MISRA C 2012 Rule 8.4 violation
>> warning.
>>
>> Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Committed.

Cheers,

> 
> 
>> ---
>>   xen/common/device_tree.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
>> index 0e8798bd24..6c9712ab7b 100644
>> --- a/xen/common/device_tree.c
>> +++ b/xen/common/device_tree.c
>> @@ -496,7 +496,7 @@ static int __dt_n_addr_cells(const struct dt_device_node *np, bool_t parent)
>>       return DT_ROOT_NODE_ADDR_CELLS_DEFAULT;
>>   }
>>   
>> -int __dt_n_size_cells(const struct dt_device_node *np, bool_t parent)
>> +static int __dt_n_size_cells(const struct dt_device_node *np, bool_t parent)
>>   {
>>       const __be32 *ip;
>>   
>> -- 
>> 2.34.1
>>

-- 
Julien Grall