summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2020-04-29 12:45:18 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2020-05-17 18:52:01 +0900
commit8a45fe7053a2c33b786706bdcd77d7ccf1531ef7 (patch)
tree003b1f0828e9d1f8841f9c043575d9ebfa36fe27
parente079a08c60744af54eed7b7f957d6c87b163f25e (diff)
samples: uhid: fix warnings in uhid-example
Fix warnings seen when building for 32-bit architecture. Use "%xd" for arguments of type size_t to fix the warnings. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-rw-r--r--samples/uhid/uhid-example.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/uhid/uhid-example.c b/samples/uhid/uhid-example.c
index b72d645ce828..015cb06a241e 100644
--- a/samples/uhid/uhid-example.c
+++ b/samples/uhid/uhid-example.c
@@ -165,7 +165,7 @@ static int uhid_write(int fd, const struct uhid_event *ev)
fprintf(stderr, "Cannot write to uhid: %m\n");
return -errno;
} else if (ret != sizeof(*ev)) {
- fprintf(stderr, "Wrong size written to uhid: %ld != %lu\n",
+ fprintf(stderr, "Wrong size written to uhid: %zd != %zu\n",
ret, sizeof(ev));
return -EFAULT;
} else {
@@ -236,7 +236,7 @@ static int event(int fd)
fprintf(stderr, "Cannot read uhid-cdev: %m\n");
return -errno;
} else if (ret != sizeof(ev)) {
- fprintf(stderr, "Invalid size read from uhid-dev: %ld != %lu\n",
+ fprintf(stderr, "Invalid size read from uhid-dev: %zd != %zu\n",
ret, sizeof(ev));
return -EFAULT;
}