public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ioctl_ns.2, stat.2: drop unneeded uintmax_t casts.
@ 2022-08-30 19:58 Jakub Wilk
  2022-08-30 20:13 ` Jakub Wilk
  2022-08-30 20:55 ` Alejandro Colomar
  0 siblings, 2 replies; 4+ messages in thread
From: Jakub Wilk @ 2022-08-30 19:58 UTC (permalink / raw)
  To: Michael Kerrisk, Alejandro Colomar; +Cc: linux-man

major() and minor() return unsigned int,
so the typecasts to uintmax_t are not needed.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
---
 man2/ioctl_ns.2 | 12 ++++++------
 man2/stat.2     |  6 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/man2/ioctl_ns.2 b/man2/ioctl_ns.2
index 95b39ccac..02c1dab11 100644
--- a/man2/ioctl_ns.2
+++ b/man2/ioctl_ns.2
@@ -293,9 +293,9 @@ main(int argc, char *argv[])
             exit(EXIT_FAILURE);
         }
         printf("Device/Inode of owning user namespace is: "
-               "[%jx,%jx] / %ju\en",
-               (uintmax_t) major(sb.st_dev),
-               (uintmax_t) minor(sb.st_dev),
+               "[%x,%x] / %ju\en",
+               major(sb.st_dev),
+               minor(sb.st_dev),
                (uintmax_t) sb.st_ino);
 
         close(userns_fd);
@@ -323,9 +323,9 @@ main(int argc, char *argv[])
             perror("fstat\-parentns");
             exit(EXIT_FAILURE);
         }
-        printf("Device/Inode of parent namespace is: [%jx,%jx] / %ju\en",
-               (uintmax_t) major(sb.st_dev),
-               (uintmax_t) minor(sb.st_dev),
+        printf("Device/Inode of parent namespace is: [%x,%x] / %ju\en",
+               major(sb.st_dev),
+               minor(sb.st_dev),
                (uintmax_t) sb.st_ino);
 
         close(parent_fd);
diff --git a/man2/stat.2 b/man2/stat.2
index 585a20484..bdd6d15e3 100644
--- a/man2/stat.2
+++ b/man2/stat.2
@@ -481,9 +481,9 @@ main(int argc, char *argv[])
         exit(EXIT_FAILURE);
     }
 
-    printf("ID of containing device:  [%jx,%jx]\en",
-           (uintmax_t) major(sb.st_dev),
-           (uintmax_t) minor(sb.st_dev));
+    printf("ID of containing device:  [%x,%x]\en",
+           major(sb.st_dev),
+           minor(sb.st_dev));
 
     printf("File type:                ");
 
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-30 20:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-30 19:58 [PATCH] ioctl_ns.2, stat.2: drop unneeded uintmax_t casts Jakub Wilk
2022-08-30 20:13 ` Jakub Wilk
2022-08-30 20:57   ` Alejandro Colomar
2022-08-30 20:55 ` Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox