]> Git Repo - J-linux.git/commitdiff
samples: Fix warning in fsnotify sample
authorJan Kara <[email protected]>
Mon, 1 Nov 2021 11:47:32 +0000 (12:47 +0100)
committerJan Kara <[email protected]>
Mon, 1 Nov 2021 11:48:01 +0000 (12:48 +0100)
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 <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
samples/fanotify/fs-monitor.c

index a0e44cd31e6f3319299d9dc266a2dca74efb19b6..2e08a1807db77722c15116f3bf9e965ff1e3bb88 100644 (file)
@@ -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;
                }
 
This page took 0.051378 seconds and 4 git commands to generate.