linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michael Schmitz <schmitzmic@gmail.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-m68k <linux-m68k@lists.linux-m68k.org>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH RFC v2] m68k: remove get_fs()/set_fs()
Date: Thu, 8 Jul 2021 06:31:45 +0200	[thread overview]
Message-ID: <20210708043145.GB17672@lst.de> (raw)
In-Reply-To: <CAHk-=wgCp0X4Q=GkDF1j1=_XTq4gA_ZsKUXfkPBeeTJcoS6gwQ@mail.gmail.com>

On Wed, Jul 07, 2021 at 08:01:33PM -0700, Linus Torvalds wrote:
> The '#' turns the argument into a string, but it was already
> _supposed_ to be a string. But no, the problem is that it turns the
> macro name MOVES into the _string_ "MOVES".
> 
> Which happens to compile just fine, because "moves" is a real
> instruction. But it's actually _meant_ to be a macro that expands to
> either the string "moves" or "move".
> 
> So what happens is that at least in Christoph's version, I think the
> code _always_ uses "MOVES", even in configurations where the macro
> MOVES should have just become "move".
> 
> So it all builds fine, looks fine to the assembler, but it uses the
> wrong instruction.
> 
> Macro expansion with the '#' character and other macros used as
> arguments is something people need to be very careful with.  It's why
> we have a whole header file for just the "stringify" operation, see
> <linux/stringify.h>
> 
> But in this case, it shouldn't have used '#' at all, since the
> argument was already a string, and never needed to be turned into a
> string by the pre-processor.

Yes, that problem exists, but just removing the # causes "inst" to go
into the cpp output.  Let me brush up my cpp-foo.

  parent reply	other threads:[~2021-07-08  4:31 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08  1:48 [PATCH RFC v2] m68k: remove get_fs()/set_fs() Michael Schmitz
2021-07-08  2:51 ` Linus Torvalds
2021-07-08  3:01   ` Linus Torvalds
2021-07-08  3:37     ` Michael Schmitz
2021-07-08  4:31     ` Christoph Hellwig [this message]
2021-07-08  4:33       ` Michael Schmitz
2021-07-08  4:58         ` Christoph Hellwig
2021-07-08  5:48           ` Michael Schmitz
2021-07-08 12:57             ` Christoph Hellwig
2021-07-08 18:20               ` Linus Torvalds
2021-07-09  0:05                 ` Michael Schmitz
2021-07-08 19:28               ` Michael Schmitz
2021-07-09  0:31                 ` Michael Schmitz
2021-07-09  4:22                   ` Christoph Hellwig
2021-07-09  5:47                     ` Michael Schmitz
2021-07-09  7:29                     ` Geert Uytterhoeven
2021-07-09  8:34                       ` Michael Schmitz
2021-07-09  8:53                         ` Christoph Hellwig
2021-07-09  9:00                           ` Michael Schmitz
2021-07-09 11:20                             ` Geert Uytterhoeven
2021-07-09 19:25                               ` Michael Schmitz
2021-07-09 19:52                                 ` Michael Schmitz
2021-07-09 20:03                                   ` Linus Torvalds
2021-07-09 20:13                                     ` Linus Torvalds
2021-07-09 19:53                                 ` Linus Torvalds
2021-07-09 21:08                                   ` Michael Schmitz
2021-07-09 21:18                                     ` Linus Torvalds
2021-07-10  2:30                                       ` Michael Schmitz
2021-07-09 11:35                           ` Geert Uytterhoeven
2021-07-08  7:36     ` Andreas Schwab
2021-07-08  4:28   ` Christoph Hellwig

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=20210708043145.GB17672@lst.de \
    --to=hch@lst.de \
    --cc=geert@linux-m68k.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=schmitzmic@gmail.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).