xen/arm: Fix printk specifiers and arguments in iomem_remove_cb()

When building Xen for arm32 with CONFIG_DTB_OVERLAY, the following
error is printed:

common/dt-overlay.c: In function ‘iomem_remove_cb’:
././include/xen/config.h:55:24: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘long unsigned int’ [-Werror=format=]

Function parameters s and e (denoting MMIO region) are of type unsigned
long and indicate frame numbers and not addresses. This also means that
the arguments passed to printk() are incorrect (using PAGE_ALIGN() or
PAGE_MASK ANDed with a frame number results in unwanted output). Fix it.

Take the opportunity to switch to %pd specifier to print domain id in
a consolidated way.

Fixes: 7e5c4a8b86 ("xen/arm: Implement device tree node removal functionalities")
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Vikram Garhwal <vikram.garhwal@amd.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Michal Orzel authored and Stefano Stabellini committed 2023-09-06 17:37:19 -07:00
1 parent 6242d1b745
commit b2dd946ece
1 file changed
+2 -4
+2 -4
View File
@@ -251,10 +251,8 @@ static int iomem_remove_cb(unsigned long s, unsigned long e, void *dom,
rc = iomem_deny_access(d, s, e);
if ( rc )
{
printk(XENLOG_ERR "Unable to remove dom%d access to"
" 0x%"PRIx64" - 0x%"PRIx64"\n",
d->domain_id,
s & PAGE_MASK, PAGE_ALIGN(e) - 1);
printk(XENLOG_ERR "Unable to remove %pd access to %#lx - %#lx\n",
d, s, e);
}
else
*c += e - s + 1;
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.