summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2021-11-01 14:47:32 +0300
committerJan Kara <jack@suse.cz>2021-11-01 14:48:01 +0300
commitb7eccf75c28e5469bb4685a03310dbb66ee323f9 (patch)
treedc55c3046ad62280ddd6c7a5fc4929c86f64be6e /samples
parent9abeae5d4458326e16df7ea237104b58c27dfd77 (diff)
downloadlinux-b7eccf75c28e5469bb4685a03310dbb66ee323f9.tar.xz
samples: Fix warning in fsnotify sample
The fsnotify sample code generates the following warning on powerpc: samples/fanotify/fs-monitor.c: In function 'handle_notifications': samples/fanotify/fs-monitor.c:68:36: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type '__u64' {aka 'long unsigned int'} [-Wformat=] 68 | printf("unexpected FAN MARK: %llx\n", event->mask); | ~~~^ ~~~~~~~~~~~ | | | | | __u64 {aka long unsigned int} | long long unsigned int | %lx Fix the problem by explicitely typing the argument to proper type. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'samples')
-rw-r--r--samples/fanotify/fs-monitor.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/samples/fanotify/fs-monitor.c b/samples/fanotify/fs-monitor.c
index a0e44cd31e6f..2e08a1807db7 100644
--- a/samples/fanotify/fs-monitor.c
+++ b/samples/fanotify/fs-monitor.c
@@ -65,7 +65,8 @@ static void handle_notifications(char *buffer, int len)
for (; FAN_EVENT_OK(event, len); event = FAN_EVENT_NEXT(event, len)) {
if (event->mask != FAN_FS_ERROR) {
- printf("unexpected FAN MARK: %llx\n", event->mask);
+ printf("unexpected FAN MARK: %llx\n",
+ (unsigned long long)event->mask);
goto next_event;
}