Skip to contentSkip to conversation

perf beauty ioctl cmd: The 'fd' arg is signed

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Feb 15, 2019 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  e1be4a5c03e1b282633e5528ea634c1cc2095c43
Gitweb:     https://git.kernel.org/tip/e1be4a5c03e1b282633e5528ea634c1cc2095c43
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Tue, 12 Feb 2019 10:12:28 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 14 Feb 2019 13:31:11 -0300

perf beauty ioctl cmd: The 'fd' arg is signed

It is possible to pass a negative number as the fd and that has to be handled, so stop using 'unsigned int fd' in the ioctl syscall 'cmd' beautifier.

---
 tools/perf/trace/beauty/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/trace/beauty/ioctl.c +1 -1
index 620350d41209..52242fa4072b 100644
@@ -175,7 +175,7 @@ static size_t ioctl__scnprintf_cmd(unsigned long cmd, char *bf, size_t size, boo
 size_t syscall_arg__scnprintf_ioctl_cmd(char *bf, size_t size, struct syscall_arg *arg)
 {
 	unsigned long cmd = arg->val;
-	unsigned int fd = syscall_arg__val(arg, 0);
+	int fd = syscall_arg__val(arg, 0);
 	struct file *file = thread__files_entry(arg->thread, fd);
 
 	if (file != NULL) {