linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Jan Kara <jack@suse.cz>,
	Gabriel Krisman Bertazi <krisman@collabora.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: linux-next: build warning after merge of the ext3 tree
Date: Mon, 1 Nov 2021 12:50:58 +0100	[thread overview]
Message-ID: <20211101115058.GC21679@quack2.suse.cz> (raw)
In-Reply-To: <20211028211053.0c504d48@canb.auug.org.au>

[-- Attachment #1: Type: text/plain, Size: 1037 bytes --]

On Thu 28-10-21 21:10:53, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the ext3 tree, today's linux-next build (powerpc
> allyesconfig) produced this warning:
> 
> 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
> 
> Introduced by commit
> 
>   5451093081db ("samples: Add fs error monitoring example")

Thanks for report Stephen. I've added attached patch to my tree to fix it
up.

									Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

[-- Attachment #2: 0001-samples-Fix-warning-in-fsnotify-sample.patch --]
[-- Type: text/x-patch, Size: 1695 bytes --]

From b7eccf75c28e5469bb4685a03310dbb66ee323f9 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Mon, 1 Nov 2021 12:47:32 +0100
Subject: [PATCH] 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>
---
 samples/fanotify/fs-monitor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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;
 		}
 
-- 
2.26.2


  reply	other threads:[~2021-11-01 11:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 10:10 linux-next: build warning after merge of the ext3 tree Stephen Rothwell
2021-11-01 11:50 ` Jan Kara [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-10-28 12:21 Stephen Rothwell
2021-10-28 21:05 ` Gabriel Krisman Bertazi
2021-11-01 11:45   ` Jan Kara
2010-02-24  8:05 Stephen Rothwell
2010-02-24 10:58 ` Jan Kara
2010-02-24 11:15   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211101115058.GC21679@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=krisman@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).