[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200910211344.3562-11-colomar.6.4.3@gmail.com>
Date: Thu, 10 Sep 2020 23:13:31 +0200
From: Alejandro Colomar <colomar.6.4.3@...il.com>
To: mtk.manpages@...il.com
Cc: linux-man@...r.kernel.org, linux-kernel@...r.kernel.org,
Alejandro Colomar <colomar.6.4.3@...il.com>
Subject: [PATCH 10/24] ioctl_ns.2: Remove unneeded cast
Both major(3) and minor(3) return an 'unsigned int',
so there is no need to use a 'long' for printing.
Moreover, it should have been 'unsigned long',
as "%lx" expects an unsigned type.
Signed-off-by: Alejandro Colomar <colomar.6.4.3@...il.com>
---
man2/ioctl_ns.2 | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/man2/ioctl_ns.2 b/man2/ioctl_ns.2
index 818dde32c..bf832a2c7 100644
--- a/man2/ioctl_ns.2
+++ b/man2/ioctl_ns.2
@@ -316,9 +316,8 @@ main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
printf("Device/Inode of owning user namespace is: "
- "[%lx,%lx] / %ld\en",
- (long) major(sb.st_dev), (long) minor(sb.st_dev),
- (long) sb.st_ino);
+ "[%x,%x] / %ld\en",
+ major(sb.st_dev), minor(sb.st_dev), (long) sb.st_ino);
close(userns_fd);
}
@@ -345,9 +344,8 @@ main(int argc, char *argv[])
perror("fstat\-parentns");
exit(EXIT_FAILURE);
}
- printf("Device/Inode of parent namespace is: [%lx,%lx] / %ld\en",
- (long) major(sb.st_dev), (long) minor(sb.st_dev),
- (long) sb.st_ino);
+ printf("Device/Inode of parent namespace is: [%x,%x] / %ld\en",
+ major(sb.st_dev), minor(sb.st_dev), (long) sb.st_ino);
close(parent_fd);
}
--
2.28.0
Powered by blists - more mailing lists