device-tree: address violation of MISRA C Rule 5.5

Address a violation of MISRA C:2012 Rule 5.5:
"Identifiers shall be distinct from macro names".

Reports for service MC3A2.R5.5:
xen/include/xen/fdt-domain-build.h: non-compliant parameter 'copy_to_guest'
xen/include/xen/guest_access.h: non-compliant macro 'copy_to_guest'

Rename 'copy_to_guest' function parameter to 'cb' for compliance.
No functional changes.

Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Dmytro Prokopchuk authored and Jan Beulich committed 2025-07-10 13:42:56 +02:00
1 parent b2d78fab9f
commit 84f3967153
2 files changed
+8 -9

No files matched your search

+6 -7
View File
@@ -336,7 +336,7 @@ void __init allocate_memory(struct domain *d, struct kernel_info *kinfo)
}
void __init dtb_load(struct kernel_info *kinfo,
copy_to_guest_phys_cb copy_to_guest)
copy_to_guest_phys_cb cb)
{
unsigned long left;
@@ -344,9 +344,9 @@ void __init dtb_load(struct kernel_info *kinfo,
kinfo->d, kinfo->dtb_paddr,
kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
left = copy_to_guest(kinfo->d, kinfo->dtb_paddr,
kinfo->fdt,
fdt_totalsize(kinfo->fdt));
left = cb(kinfo->d, kinfo->dtb_paddr,
kinfo->fdt,
fdt_totalsize(kinfo->fdt));
if ( left != 0 )
panic("Unable to copy the DTB to %pd memory (left = %lu bytes)\n",
@@ -355,7 +355,7 @@ void __init dtb_load(struct kernel_info *kinfo,
}
void __init initrd_load(struct kernel_info *kinfo,
copy_to_guest_phys_cb copy_to_guest)
copy_to_guest_phys_cb cb)
{
const struct boot_module *mod = kinfo->initrd;
paddr_t load_addr = kinfo->initrd_paddr;
@@ -398,8 +398,7 @@ void __init initrd_load(struct kernel_info *kinfo,
if ( !initrd )
panic("Unable to map the %pd initrd\n", kinfo->d);
res = copy_to_guest(kinfo->d, load_addr,
initrd, len);
res = cb(kinfo->d, load_addr, initrd, len);
if ( res != 0 )
panic("Unable to copy the initrd in the %pd memory\n", kinfo->d);
+2 -2
View File
@@ -50,10 +50,10 @@ typedef unsigned long (*copy_to_guest_phys_cb)(struct domain *d,
unsigned int len);
void initrd_load(struct kernel_info *kinfo,
copy_to_guest_phys_cb copy_to_guest);
copy_to_guest_phys_cb cb);
void dtb_load(struct kernel_info *kinfo,
copy_to_guest_phys_cb copy_to_guest);
copy_to_guest_phys_cb cb);
int find_unallocated_memory(const struct kernel_info *kinfo,
const struct membanks *mem_banks[],
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.