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.