linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sam Ravnborg <sam@ravnborg.org>
Subject: Re: linux-next: rr tree build warnings
Date: Tue, 10 Nov 2009 12:50:58 +1030	[thread overview]
Message-ID: <200911101250.58516.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20091109184046.2a802372.sfr@canb.auug.org.au>

On Mon, 9 Nov 2009 06:10:46 pm Stephen Rothwell wrote:
> I am also getting some section mismatch warnings like this:
> 
> WARNING: drivers/mtd/ubi/ubi.o(.data+0x1c0): Section mismatch in reference from the variable __ops_mtd to the function .init.text:ubi_mtd_param_parse()
> The variable __ops_mtd references
> the function __init ubi_mtd_param_parse()

Right.  This needs a new rule in modpost; here's what I've added:

diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -97,10 +97,10 @@ struct kparam_array
 
 /* Obsolete - use module_param_cb() */
 #define module_param_call(name, set, get, arg, perm)			\
-	static struct kernel_param_ops __ops_##name =			\
+	static struct kernel_param_ops __param_ops_##name =		\
 		 { (void *)set, (void *)get };				\
 	__module_param_call(MODULE_PARAM_PREFIX,			\
-			    name, &__ops_##name, arg,			\
+			    name, &__param_ops_##name, arg,		\
 			    __same_type(*(arg), bool),			\
 			    (perm) + sizeof(__check_old_set_param(set))*0)
 
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -951,6 +951,13 @@ static int section_mismatch(const char *
  *   fromsec = .data*
  *   atsym   =__param*
  *
+ * Pattern 1a:
+ *   module_param_call() ops can refer to __init set function if permissions=0
+ *   The pattern is identified by:
+ *   tosec   = .init.text
+ *   fromsec = .data*
+ *   atsym   = __param_ops_*
+ *
  * Pattern 2:
  *   Many drivers utilise a *driver container with references to
  *   add, remove, probe functions etc.
@@ -984,6 +991,12 @@ static int secref_whitelist(const char *
 	    (strncmp(fromsym, "__param", strlen("__param")) == 0))
 		return 0;
 
+	/* Check for pattern 1a */
+	if (strcmp(tosec, ".init.text") == 0 &&
+	    match(fromsec, data_sections) &&
+	    (strncmp(fromsym, "__param_ops_", strlen("__param_ops_")) == 0))
+		return 0;
+
 	/* Check for pattern 2 */
 	if (match(tosec, init_exit_sections) &&
 	    match(fromsec, data_sections) &&

  reply	other threads:[~2009-11-10  2:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-09  7:31 linux-next: rr tree build warnings Stephen Rothwell
2009-11-09  7:40 ` Stephen Rothwell
2009-11-10  2:20   ` Rusty Russell [this message]
2009-11-10  5:20     ` Sam Ravnborg
2009-11-10  2:20 ` Rusty Russell
  -- strict thread matches above, loose matches on Subject: below --
2009-03-16  5:47 Stephen Rothwell
2009-01-08  6:44 Stephen Rothwell
2009-01-06  3:43 Stephen Rothwell

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=200911101250.58516.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sam@ravnborg.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).