[xen master] tools/xen-hvmctx: drop bogus casts from dump_mtrr()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] tools/xen-hvmctx: drop bogus casts from dump_mtrr()

patchbot
commit 4b04aee92cc599a186ce812f1bea5de75153e903
Author:     Jan Beulich <[hidden email]>
AuthorDate: Thu Oct 4 14:55:38 2018 +0200
Commit:     Jan Beulich <[hidden email]>
CommitDate: Thu Oct 4 14:55:38 2018 +0200

    tools/xen-hvmctx: drop bogus casts from dump_mtrr()
   
    Also make the iteration variable unsigned.
   
    Signed-off-by: Jan Beulich <[hidden email]>
    Acked-by: Wei Liu <[hidden email]>
---
 tools/misc/xen-hvmctx.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/tools/misc/xen-hvmctx.c b/tools/misc/xen-hvmctx.c
index d32989bd0d..40e77851be 100644
--- a/tools/misc/xen-hvmctx.c
+++ b/tools/misc/xen-hvmctx.c
@@ -344,19 +344,17 @@ static void dump_pmtimer(void)
 static void dump_mtrr(void)
 {
     HVM_SAVE_TYPE(MTRR) p;
-    int i;
+    unsigned int i;
+
     READ(p);
-    printf("    MTRR: PAT 0x%llx, cap 0x%llx, default 0x%llx\n",
-           (unsigned long long) p.msr_pat_cr,
-           (unsigned long long) p.msr_mtrr_cap,
-           (unsigned long long) p.msr_mtrr_def_type);
+    printf("    MTRR: PAT %#" PRIx64 ", cap %#" PRIx64 ", default %#" PRIx64 "\n",
+           p.msr_pat_cr, p.msr_mtrr_cap, p.msr_mtrr_def_type);
     for ( i = 0 ; i < MTRR_VCNT ; i++ )
-        printf("          var %i 0x%16.16llx 0x%16.16llx\n", i,
-               (unsigned long long) p.msr_mtrr_var[2 * i],
-               (unsigned long long) p.msr_mtrr_var[2 * i + 1]);
+        printf("          var %u %#18.13" PRIx64 " %#18.13" PRIx64 "\n", i,
+               p.msr_mtrr_var[2 * i], p.msr_mtrr_var[2 * i + 1]);
     for ( i = 0 ; i < NUM_FIXED_MSR ; i++ )
-        printf("          fixed %.2i 0x%16.16llx\n", i,
-               (unsigned long long) p.msr_mtrr_fixed[i]);
+        printf("          fixed %02x %#18.16" PRIx64 "\n",
+               i, p.msr_mtrr_fixed[i]);
 }
 
 static void dump_viridian_domain(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog