diff mbox series

[XEN,v3,3/6] xen/arm: change parameter name 'pa' in ioremap_addr() definition.

Message ID 74fdc69fd08d1a0e35d4f226ea0c47a6f6a3a241.1687771796.git.federico.serafini@bugseng.com (mailing list archive)
State New, archived
Headers show
Series fix violations of MISRA C:2012 Rule 8.3 on parameter names. | expand

Commit Message

Federico Serafini June 26, 2023, 9:52 a.m. UTC
In the current version of ioremap_addr() function, the declaration
uses the parameter name 'start' (consistenly with the other ioremap_*
function declarations), while the definition uses the parameter name
'pa'.
Change the parameter name 'pa' of function definition to 'start', thus
fixing a violation of MISRA C:2012 Rule 8.3 and keeping the consistency
with other ioremap_* functions.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/arm/mm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Julien Grall June 26, 2023, 2:13 p.m. UTC | #1
Hi,

On 26/06/2023 10:52, Federico Serafini wrote:
> In the current version of ioremap_addr() function, the declaration
> uses the parameter name 'start' (consistenly with the other ioremap_*
> function declarations), while the definition uses the parameter name
> 'pa'.
> Change the parameter name 'pa' of function definition to 'start', thus
> fixing a violation of MISRA C:2012 Rule 8.3 and keeping the consistency
> with other ioremap_* functions.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

> ---
>   xen/arch/arm/mm.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index e460249736..2e9860a754 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -736,10 +736,10 @@ void *__init arch_vmap_virt_end(void)
>    * This function should only be used to remap device address ranges
>    * TODO: add a check to verify this assumption
>    */
> -void *ioremap_attr(paddr_t pa, size_t len, unsigned int attributes)
> +void *ioremap_attr(paddr_t start, size_t len, unsigned int attributes)
>   {
> -    mfn_t mfn = _mfn(PFN_DOWN(pa));
> -    unsigned int offs = pa & (PAGE_SIZE - 1);
> +    mfn_t mfn = _mfn(PFN_DOWN(start));
> +    unsigned int offs = start & (PAGE_SIZE - 1);
>       unsigned int nr = PFN_UP(offs + len);
>       void *ptr = __vmap(&mfn, nr, 1, 1, attributes, VMAP_DEFAULT);
>   
> @@ -1579,7 +1579,7 @@ void put_page_type(struct page_info *page)
>       return;
>   }
>   
> -int create_grant_host_mapping(unsigned long addr, mfn_t frame,
> +int create_grant_host_mapping(unsigned long gpaddr, mfn_t frame,
>                                 unsigned int flags, unsigned int cache_flags)
>   {
>       int rc;
> @@ -1591,7 +1591,7 @@ int create_grant_host_mapping(unsigned long addr, mfn_t frame,
>       if ( flags & GNTMAP_readonly )
>           t = p2m_grant_map_ro;
>   
> -    rc = guest_physmap_add_entry(current->domain, gaddr_to_gfn(addr),
> +    rc = guest_physmap_add_entry(current->domain, gaddr_to_gfn(gpaddr),
>                                    frame, 0, t);
>   
>       if ( rc )
diff mbox series

Patch

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index e460249736..2e9860a754 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -736,10 +736,10 @@  void *__init arch_vmap_virt_end(void)
  * This function should only be used to remap device address ranges
  * TODO: add a check to verify this assumption
  */
-void *ioremap_attr(paddr_t pa, size_t len, unsigned int attributes)
+void *ioremap_attr(paddr_t start, size_t len, unsigned int attributes)
 {
-    mfn_t mfn = _mfn(PFN_DOWN(pa));
-    unsigned int offs = pa & (PAGE_SIZE - 1);
+    mfn_t mfn = _mfn(PFN_DOWN(start));
+    unsigned int offs = start & (PAGE_SIZE - 1);
     unsigned int nr = PFN_UP(offs + len);
     void *ptr = __vmap(&mfn, nr, 1, 1, attributes, VMAP_DEFAULT);
 
@@ -1579,7 +1579,7 @@  void put_page_type(struct page_info *page)
     return;
 }
 
-int create_grant_host_mapping(unsigned long addr, mfn_t frame,
+int create_grant_host_mapping(unsigned long gpaddr, mfn_t frame,
                               unsigned int flags, unsigned int cache_flags)
 {
     int rc;
@@ -1591,7 +1591,7 @@  int create_grant_host_mapping(unsigned long addr, mfn_t frame,
     if ( flags & GNTMAP_readonly )
         t = p2m_grant_map_ro;
 
-    rc = guest_physmap_add_entry(current->domain, gaddr_to_gfn(addr),
+    rc = guest_physmap_add_entry(current->domain, gaddr_to_gfn(gpaddr),
                                  frame, 0, t);
 
     if ( rc )