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

[Xen-devel] [PATCH] flask: Fix 32-bit compilation of label-pci tool



The 32-bit tools need to support 64-bit addresses, so use the correct
printf/scanf formats.

Signed-off-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
---
 tools/flask/utils/label-pci.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/tools/flask/utils/label-pci.c b/tools/flask/utils/label-pci.c
index 839ad61..ca53ea8 100644
--- a/tools/flask/utils/label-pci.c
+++ b/tools/flask/utils/label-pci.c
@@ -15,6 +15,7 @@
 #include <sys/stat.h>
 #include <string.h>
 #include <unistd.h>
+#include <inttypes.h>
 #include <libflask.h>
 
 /* Pulled from linux/include/linux/ioport.h */
@@ -76,22 +77,22 @@ int main (int argCnt, char *argv[])
                goto done;
        }
 
-       while (fscanf(f, "0x%lx 0x%lx 0x%lx\n", &start, &end, &flags) == 3) {
+       while (fscanf(f, "0x%"PRIx64" 0x%"PRIx64" 0x%"PRIx64"\n", &start, &end, 
&flags) == 3) {
                if (flags & IORESOURCE_IO) {
-                       // printf("Port %lx-%lx\n", start, end);
+                       // printf("Port %"PRIx64"-%"PRIx64"\n", start, end);
                        ret = flask_add_ioport(xch, start, end, argv[2]);
                        if (ret) {
-                               fprintf(stderr, "flask_add_ioport %lx-%lx 
failed: %d\n",
+                               fprintf(stderr, "flask_add_ioport 
%"PRIx64"-%"PRIx64" failed: %d\n",
                                                start, end, ret);
                                err = 2;
                        }
                } else if (flags & IORESOURCE_MEM) {
                        start >>= 12;
                        end >>= 12;
-                       // printf("IOMEM %lx-%lx\n", start, end);
+                       // printf("IOMEM %"PRIx64"-%"PRIx64"\n", start, end);
                        ret = flask_add_iomem(xch, start, end, argv[2]);
                        if (ret) {
-                               fprintf(stderr, "flask_add_iomem %lx-%lx 
failed: %d\n",
+                               fprintf(stderr, "flask_add_iomem 
%"PRIx64"-%"PRIx64" failed: %d\n",
                                                start, end, ret);
                                err = 2;
                        }
@@ -105,11 +106,11 @@ int main (int argCnt, char *argv[])
        if (!f)
                goto done;
        start = 0;
-       fscanf(f, "%ld", &start);
+       fscanf(f, "%" PRIu64, &start);
        if (start) {
                ret = flask_add_pirq(xch, start, argv[2]);
                if (ret) {
-                       fprintf(stderr, "flask_add_pirq %ld failed: %d\n",
+                       fprintf(stderr, "flask_add_pirq %"PRIu64" failed: %d\n",
                                        start, ret);
                        err = 2;
                }
-- 
1.7.7.3


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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