Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=83cda2bb37cb8476cd84659d9698ab48553be974
Commit:     83cda2bb37cb8476cd84659d9698ab48553be974
Parent:     2f5ee619045d923de9137b6a263a99cc2428391a
Author:     Sam Ravnborg <[EMAIL PROTECTED]>
AuthorDate: Wed Jul 25 21:52:31 2007 +0200
Committer:  Sam Ravnborg <[EMAIL PROTECTED]>
CommitDate: Wed Jul 25 21:52:31 2007 +0200

    kbuild: be more foregiving on init section naming
    
    In the whitelist function of modpost now use the same
    check to identify init_section as in other places of modpost.
    This has the effect that we now recognize sections named
    .init.text.19 as init sections and we no longer warn
    when we see these.
    
    At the same time make surrounding code readable by dropping
    use of temporary flags.
    
    Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]>
---
 scripts/mod/modpost.c |   36 ++++++++++--------------------------
 1 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index c903a16..3db4edc 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -658,8 +658,8 @@ static int data_section(const char *name)
  *   These functions may often be marked __init and we do not want to
  *   warn here.
  *   the pattern is identified by:
- *   tosec   = .init.text | .exit.text | .init.data
- *   fromsec = .data | .data.rel | .data.rel.*
+ *   tosec   = init or exit section
+ *   fromsec = data section
  *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, 
*_console, *_timer
  *
  * Pattern 3:
@@ -680,7 +680,6 @@ static int secref_whitelist(const char *modname, const char 
*tosec,
                            const char *fromsec, const char *atsym,
                            const char *refsymname)
 {
-       int f1 = 1, f2 = 1;
        const char **s;
        const char *pat2sym[] = {
                "driver",
@@ -707,31 +706,16 @@ static int secref_whitelist(const char *modname, const 
char *tosec,
                return 1;
 
        /* Check for pattern 1 */
-       if (strcmp(tosec, ".init.data") != 0)
-               f1 = 0;
-       if (strncmp(fromsec, ".data", strlen(".data")) != 0)
-               f1 = 0;
-       if (strncmp(atsym, "__param", strlen("__param")) != 0)
-               f1 = 0;
-
-       if (f1)
-               return f1;
+       if ((strcmp(tosec, ".init.data") == 0) &&
+           (strncmp(fromsec, ".data", strlen(".data")) == 0) &&
+           (strncmp(atsym, "__param", strlen("__param")) == 0))
+               return 1;
 
        /* Check for pattern 2 */
-       if ((strcmp(tosec, ".init.text") != 0) &&
-           (strcmp(tosec, ".exit.text") != 0) &&
-           (strcmp(tosec, ".init.data") != 0))
-               f2 = 0;
-       if ((strcmp(fromsec, ".data") != 0) &&
-           (strcmp(fromsec, ".data.rel") != 0) &&
-           (strncmp(fromsec, ".data.rel.", strlen(".data.rel.")) != 0))
-               f2 = 0;
-
-       for (s = pat2sym; *s; s++)
-               if (strrcmp(atsym, *s) == 0)
-                       f1 = 1;
-       if (f1 && f2)
-               return 1;
+       if ((init_section(tosec) || exit_section(tosec)) && 
data_section(fromsec))
+               for (s = pat2sym; *s; s++)
+                       if (strrcmp(atsym, *s) == 0)
+                               return 1;
 
        /* Check for pattern 3 */
        if ((strcmp(fromsec, ".text.head") == 0) &&
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to