xen/arm: change parameter names in replace_grant_host_mapping().

In the current version of replace_grant_host_mapping() function, the
declaration (correctly) uses the parameter names 'gpaddr' and
'new_gpaddr', while the definition uses the parameter names 'addr' and
'new_addr'.
Change the parameter names of the definition to 'gpaddr' and
'new_gpaddr' so that it is clear what type of address is expected and
violations of MISRA C:2012 Rule 8.3 are fixed.

In both declaration and definition of function
replace_grant_host_mapping() change the parameter name 'mfn' to 'frame',
thus improving readability and keeping consistency with name used in
create_grant_host_mapping().

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
This commit is contained in:
Federico Serafini authored and Stefano Stabellini committed 2023-06-28 15:54:21 -07:00
1 parent 06ed62d1f3
commit 5b9c96a808
2 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -38,7 +38,7 @@ static inline bool gnttab_release_host_mappings(const struct domain *d)
int create_grant_host_mapping(unsigned long gpaddr, mfn_t frame,
unsigned int flags, unsigned int cache_flags);
int replace_grant_host_mapping(unsigned long gpaddr, mfn_t mfn,
int replace_grant_host_mapping(unsigned long gpaddr, mfn_t frame,
unsigned long new_gpaddr, unsigned int flags);
/*
+5 -5
View File
@@ -1600,17 +1600,17 @@ int create_grant_host_mapping(unsigned long gpaddr, mfn_t frame,
return GNTST_okay;
}
int replace_grant_host_mapping(unsigned long addr, mfn_t mfn,
unsigned long new_addr, unsigned int flags)
int replace_grant_host_mapping(unsigned long gpaddr, mfn_t frame,
unsigned long new_gpaddr, unsigned int flags)
{
gfn_t gfn = gaddr_to_gfn(addr);
gfn_t gfn = gaddr_to_gfn(gpaddr);
struct domain *d = current->domain;
int rc;
if ( new_addr != 0 || (flags & GNTMAP_contains_pte) )
if ( new_gpaddr != 0 || (flags & GNTMAP_contains_pte) )
return GNTST_general_error;
rc = guest_physmap_remove_page(d, gfn, mfn, 0);
rc = guest_physmap_remove_page(d, gfn, frame, 0);
return rc ? GNTST_general_error : GNTST_okay;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.