Re: [PATCH,RFC] pci: do not mark exported functions as __devinit

Sam Ravnborg
2007-03-02T23:02:00Z

>
> 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;
}