linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Christian Brauner <brauner@kernel.org>,
	Tong Tiangen <tongtiangen@huawei.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 vfs-brauner tree
Date: Wed, 6 Mar 2024 15:37:03 +1100	[thread overview]
Message-ID: <20240306153703.499661d2@canb.auug.org.au> (raw)
In-Reply-To: <CAHk-=whdTCEDaUPTMHUQXPQHuM8dhBi8yWbNAL11yE_ODqR_uA@mail.gmail.com>

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

Hi all,

On Tue, 5 Mar 2024 18:48:30 -0800 Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> On Tue, 5 Mar 2024 at 15:51, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > fs/coredump.c: In function 'dump_user_range':
> > fs/coredump.c:923:40: warning: left-hand operand of comma expression has no effect [-Wunused-value]
> >   923 | #define dump_page_copy(src, dst) ((dst), (src))
> >       |                                        ^
> > fs/coredump.c:948:58: note: in expansion of macro 'dump_page_copy'
> >   948 |                         int stop = !dump_emit_page(cprm, dump_page_copy(page, dump_page));
> >       |                                                          ^~~~~~~~~~~~~~
> >
> > Introduced by commit
> >
> >   4630f2caafcd ("coredump: get machine check errors early rather than during iov_iter")  
> 
> Bah. If comes from that
> 
>   #define dump_page_copy(src,dst) ((dst),(src))
> 
> and I did it that way because I wanted to avoid *another* warning,
> namely the "dst not used" thing.
> 
> But it would have probably been better to either make it an inline
> function, or maybe an explicit cast, eg
> 
>   #define dump_page_copy(src,dst) ((void)(dst),(src))
> 
> or whatever.

This became a build failure for my i386 defconfig build, so I did this:

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 6 Mar 2024 15:28:12 +1100
Subject: [PATCH] fix up for "coredump: get machine check errors early rather
 than during iov_iter"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 fs/coredump.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/coredump.c b/fs/coredump.c
index ea155ffee14c..5353b7ac67f2 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -920,7 +920,10 @@ static struct page *dump_page_copy(struct page *src, struct page *dst)
 
 #define dump_page_alloc() ((struct page *)8) // Not NULL
 #define dump_page_free(x) do { } while (0)
-#define dump_page_copy(src, dst) ((dst), (src))
+static struct page *dump_page_copy(struct page *src, struct page *dst)
+{
+        return NULL;
+}
 
 #endif
 
-- 
2.43.0

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2024-03-06  4:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 23:51 linux-next: build warning after merge of the vfs-brauner tree Stephen Rothwell
2024-03-06  2:48 ` Linus Torvalds
2024-03-06  4:37   ` Stephen Rothwell [this message]
2024-03-06  4:47     ` Linus Torvalds
2024-03-06  9:55       ` Christian Brauner
2024-03-06  4:58     ` Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2024-01-17  2:39 Stephen Rothwell
2023-12-21  7:48 Stephen Rothwell
2023-12-21 13:19 ` David Howells
2023-11-24  2:13 Stephen Rothwell
2023-11-24  7:58 ` Amir Goldstein
2023-09-25  4:31 Stephen Rothwell
2023-08-15 11:15 Stephen Rothwell
2023-08-07  5:38 Stephen Rothwell
2023-07-31  3:58 Stephen Rothwell
2023-07-04  3:51 Stephen Rothwell
2023-05-24  3:46 Stephen Rothwell
2023-05-24  9:06 ` Christian Brauner

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=20240306153703.499661d2@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=brauner@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=tongtiangen@huawei.com \
    --cc=torvalds@linux-foundation.org \
    /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).