[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



commit b2dd946ece74e2b6e0601f28caef72f4f9950102
Author:     Michal Orzel <michal.orzel@xxxxxxx>
AuthorDate: Wed Sep 6 12:30:14 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Wed Sep 6 17:37:19 2023 -0700

    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: 7e5c4a8b86f1 ("xen/arm: Implement device tree node removal 
functionalities")
    Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
    Reviewed-by: Vikram Garhwal <vikram.garhwal@xxxxxxx>
    Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/common/dt-overlay.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/common/dt-overlay.c b/xen/common/dt-overlay.c
index b07a6128dc..5663a049e9 100644
--- a/xen/common/dt-overlay.c
+++ b/xen/common/dt-overlay.c
@@ -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;
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.