]> granicus.if.org Git - strace/blobdiff - block.c
Remove recently introduced use of ULONG_MAX
[strace] / block.c
diff --git a/block.c b/block.c
index 14453a42d4654ab6871e9cc7dd7341969a091201..ea571b6df245f68312ec288ee0500ddc514d14c5 100644 (file)
--- a/block.c
+++ b/block.c
@@ -26,9 +26,6 @@
  */
 
 #include "defs.h"
-#ifdef LINUX
-#include <stdint.h>
-#include <inttypes.h>
 #include <linux/blkpg.h>
 #include <linux/fs.h>
 #include <linux/hdreg.h>
@@ -93,7 +90,7 @@ print_blkpg_req(struct tcb *tcp, struct blkpg_ioctl_arg *blkpg)
 {
        struct blkpg_partition p;
 
-       tprintf("{");
+       tprints("{");
        printxval(blkpg_ops, blkpg->op, "BLKPG_???");
 
        tprintf(", flags=%d, datalen=%d, ",
@@ -139,7 +136,7 @@ block_ioctl(struct tcb *tcp, long code, long arg)
                        if (syserror(tcp) || umove(tcp, arg, &val) < 0)
                                tprintf(", %#lx", arg);
                        else
-                               tprintf(", %hu", val);
+                               tprintf(", %u", (unsigned)val);
                }
                break;
 
@@ -226,10 +223,12 @@ block_ioctl(struct tcb *tcp, long code, long arg)
                        if (syserror(tcp) || umove(tcp, arg, &geo) < 0)
                                tprintf(", %#lx", arg);
                        else
-                               tprintf(", {heads=%hhu, sectors=%hhu, "
-                                       "cylinders=%hu, start=%lu}",
-                                       geo.heads, geo.sectors,
-                                       geo.cylinders, geo.start);
+                               tprintf(", {heads=%u, sectors=%u, "
+                                       "cylinders=%u, start=%lu}",
+                                       (unsigned)geo.heads,
+                                       (unsigned)geo.sectors,
+                                       (unsigned)geo.cylinders,
+                                       geo.start);
                }
                break;
 
@@ -239,7 +238,7 @@ block_ioctl(struct tcb *tcp, long code, long arg)
                        if (umove(tcp, arg, &blkpg) < 0)
                                tprintf(", %#lx", arg);
                        else {
-                               tprintf(", ");
+                               tprints(", ");
                                print_blkpg_req(tcp, &blkpg);
                        }
                }
@@ -251,10 +250,10 @@ block_ioctl(struct tcb *tcp, long code, long arg)
                        if (umove(tcp, arg, &buts) < 0)
                                tprintf(", %#lx", arg);
                        else
-                               tprintf(", {act_mask=%hu, buf_size=%u, "
+                               tprintf(", {act_mask=%u, buf_size=%u, "
                                        "buf_nr=%u, start_lba=%" PRIu64 ", "
                                        "end_lba=%" PRIu64 ", pid=%u}",
-                                       buts.act_mask, buts.buf_size,
+                                       (unsigned)buts.act_mask, buts.buf_size,
                                        buts.buf_nr, buts.start_lba,
                                        buts.end_lba, buts.pid);
                }
@@ -282,4 +281,3 @@ block_ioctl(struct tcb *tcp, long code, long arg)
        };
        return 1;
 }
-#endif /* LINUX */