mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Greg KH <greg@kroah.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH,RFC] pci: do not mark exported functions as __devinit
Date: Sat, 3 Mar 2007 00:02:14 +0100	[thread overview]
Message-ID: <20070302230214.GC22555@uranus.ravnborg.org> (raw)
In-Reply-To: <20070302204752.GA24716@kroah.com>

> 
> Yes, we allow them to be exported globally, as other init code might
> need to call them, like these functions.
> 
> So yes, I think we need to find a way to fix the warning tools, as the
> code is correct here.

This was the patch that I made to ignore these.
It is on top of other pending changes to modpost so it will not
apply.
I had to check for _ksymtab* because we have various
section names for ksymtab. (_gpl, _future etc.)

	Sam

---
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 9042039..9e80dc5 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -625,6 +625,13 @@ static int strrcmp(const char *s, const char *sub)
  *  tosec      = .init.data
  *  fromsec    = .text*
  *  refsymname = logo_
+ *
+ * Pattern 8:
+ *  Symbols exported may be marked __init because we need to
+ *  export functions that are only used by init function.
+ *  The pattern is:
+ *  tosec    = .init.text
+ *  fromsec  = __ksymtab*
  **/
 static int secref_whitelist(const char *modname, const char *tosec,
 			    const char *fromsec, const char *atsym,
@@ -702,6 +709,10 @@ static int secref_whitelist(const char *modname, const char *tosec,
 	    (strncmp(fromsec, ".text", strlen(".text")) == 0) &&
 	    (strncmp(refsymname, "logo_", strlen("logo_")) == 0))
 		return 1;
+	/* Check for pattern 8 */
+	if ((strcmp(tosec, ".init.text") == 0) &&
+	    (strncmp(fromsec, "__ksymtab", strlen("__ksymtab")) == 0))
+		return 1;
 	return 0;
 }
 

  parent reply	other threads:[~2007-03-02 23:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-27  9:27 Sam Ravnborg
2007-03-02 20:47 ` Greg KH
2007-03-02 22:55   ` Sam Ravnborg
2007-03-02 22:59   ` [PATCH] pci: fix section mismatch warning Sam Ravnborg
2007-03-02 23:27     ` patch pci-fix-section-mismatch-warning.patch added to gregkh-2.6 tree gregkh
2007-03-02 23:02   ` Sam Ravnborg [this message]
2007-03-02 23:34     ` [PATCH,RFC] pci: do not mark exported functions as __devinit Greg KH

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=20070302230214.GC22555@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome