linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Stanislaw Gruszka <sgruszka@redhat.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Johannes Berg <johannes.berg@intel.com>,
	Wey-Yi Guy <wey-yi.w.guy@intel.com>,
	"John W. Linville" <linville@tuxdriver.com>
Subject: Re: linux-next: build failure after merge of the modules tree
Date: Mon, 03 Dec 2012 10:59:21 +1030	[thread overview]
Message-ID: <87d2ysj7vi.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20121128110145.GA3701@redhat.com>

Stanislaw Gruszka <sgruszka@redhat.com> writes:

> On Mon, Nov 26, 2012 at 03:10:46PM +1100, Stephen Rothwell wrote:
>> After merging the modules tree, today's linux-next build (x86_64
>> allmodconfig) failed like this:
>> 
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1196:1: error: invalid suffix "n_disabletype__8" on integer constant
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1196:1: error: expected identifier or '(' before numeric constant
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1198:1: error: invalid suffix "n_disable__9" on integer constant
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1198:1: error: expected identifier or '(' before numeric constant
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1263:1: error: invalid suffix "ghz_disabletype__32" on integer constant
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1263:1: error: expected identifier or '(' before numeric constant
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1264:1: error: invalid suffix "ghz_disable__33" on integer constant
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1264:1: error: expected identifier or '(' before numeric constant
>> drivers/net/wireless/iwlegacy/4965-mac.c:6825:1: error: invalid suffix "n_disabletype__11" on integer constant
>> drivers/net/wireless/iwlegacy/4965-mac.c:6825:1: error: expected identifier or '(' before numeric constant
>> drivers/net/wireless/iwlegacy/4965-mac.c:6826:1: error: invalid suffix "n_disable__12" on integer constant
>> drivers/net/wireless/iwlegacy/4965-mac.c:6826:1: error: expected identifier or '(' before numeric constant
>> 
>> Presumably caused by commit 58876af0436e ("moduleparam: use __UNIQUE_ID
>> ()").  This commit removed the "__mod_" prefix that used to be added to
>> the front of the "name" passed to module_param_named().  Admittedly, the
>> documentation says that "name" must be "a valid C identifier which is the
>> parameter name", but the (ab)usage here used to work (the name starts
>> with a number).
>
> I prefer not to change module parameters name, since there are users
> who use current name in they modprobe config.
>
> Stanislaw

Yes, the names can't be changed.

Here's the patch I've applied, which fixes it:

>From 7a918c7fb6499179e14a4e23a5ccff0ab920ffe0 Mon Sep 17 00:00:00 2001
From: Rusty Russell <rusty@rustcorp.com.au>
Date: Mon, 3 Dec 2012 10:49:29 +1030
Subject: [PATCH] compiler: fix UNIQUE_ID() for non-identifier names.

Some modules have parameters starting with digits, so always prepend UNIQUE_ID_
which ensures we produce a valid identifier, plus leave a clue if you
should encounter such a symbol.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 include/linux/compiler-gcc4.h |    2 +-
 include/linux/compiler.h      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index 8908821..56c802c 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -31,7 +31,7 @@
 
 #define __linktime_error(message) __attribute__((__error__(message)))
 
-#define __UNIQUE_ID(prefix) __PASTE(prefix, __PASTE(__, __COUNTER__))
+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
 
 #if __GNUC_MINOR__ >= 5
 /*
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index c55ae87..5f45335 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -170,7 +170,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
 
 /* Not-quite-unique ID. */
 #ifndef __UNIQUE_ID
-# define __UNIQUE_ID(prefix) __PASTE(__PASTE(prefix, __), __LINE__)
+# define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__)
 #endif
 
 #endif /* __KERNEL__ */
-- 
1.7.10.4


  reply	other threads:[~2012-12-03  2:46 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26  4:10 linux-next: build failure after merge of the modules tree Stephen Rothwell
2012-11-28 11:02 ` Stanislaw Gruszka
2012-12-03  0:29   ` Rusty Russell [this message]
     [not found] <mb_jUGmjgayTheAB5ZLGso-I856wAQhMkb6zPGnzUyAoUjhzm-QIzkGPLTe-sPI29ax91vO1D3aVy6J7rdTtgg==@protonmail.internalid>
2025-11-04  4:45 ` Stephen Rothwell
2025-11-04 10:15   ` Andreas Hindborg
2025-11-05  4:51   ` Stephen Rothwell
2025-11-05  6:15     ` Daniel Gomez
2025-12-04 22:58     ` Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2024-02-02  1:03 Stephen Rothwell
2022-11-14  0:13 Stephen Rothwell
2022-11-14  8:01 ` Jiri Olsa
2022-11-14  9:08   ` Leizhen (ThunderTown)
2022-02-21 16:07 broonie
2022-02-23  0:32 ` Luis Chamberlain
2022-02-28  5:13   ` Stephen Rothwell
2022-02-28 18:16     ` Luis Chamberlain
2021-02-09 10:08 Stephen Rothwell
2021-02-09 15:16 ` Jessica Yu
2021-02-09 16:06   ` Christoph Hellwig
2021-02-09 21:50   ` Stephen Rothwell
2021-02-10  8:06     ` Jessica Yu
2021-02-10  8:37       ` Masahiro Yamada
2021-02-11  6:19         ` Masahiro Yamada
2021-02-10 12:21       ` Stephen Rothwell
2021-02-10 16:16         ` Jessica Yu
2019-06-25  4:27 Stephen Rothwell
2015-12-01 20:23 Mark Brown
2015-12-02  3:23 ` Rusty Russell
2015-11-27  1:26 Stephen Rothwell
2015-11-27  2:57 ` Rusty Russell
2015-06-25  6:54 Stephen Rothwell
2015-06-25  9:51 ` Dan Streetman
2015-06-24  1:37 Stephen Rothwell
2015-06-24 18:18 ` Dan Streetman
2015-06-24 22:57   ` Stephen Rothwell
2015-06-25  1:50     ` Stephen Rothwell
2014-12-18  2:05 Stephen Rothwell
2014-08-07  3:20 Stephen Rothwell
2014-08-07 11:37 ` Rusty Russell
2014-08-07 13:03   ` Stephen Rothwell
2014-08-07 13:07     ` Rusty Russell
2014-08-08  1:33       ` Stephen Rothwell
2014-07-28  3:58 Stephen Rothwell
2014-07-28 11:38 ` Rusty Russell
2014-03-25  3:02 Stephen Rothwell
2014-03-31  3:45 ` Rusty Russell
2012-11-02  1:57 Stephen Rothwell
2012-11-02  3:16 ` Rusty Russell

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=87d2ysj7vi.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=johannes.berg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=sfr@canb.auug.org.au \
    --cc=sgruszka@redhat.com \
    --cc=wey-yi.w.guy@intel.com \
    /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).