Re: [PATCH] Generic dead function optimisation
Bill Wendling (wendling@ganymede.isdn.uiuc.edu)
Tue, 25 Apr 2000 10:13:08 -0500
Also sprach Andi Kleen:
}
} funca and funcb can be called from outside the module. They are still
} declared static. If you trust static to mean ``cannot be called from outside''
} you'll quickly fall flat onto your face.
} Overall you want a flat name space anyways, to make tools like cscope or
} [ce]tags work, so it is a good idea to use explicit bla_* prefixes anyways.
} With that static is rather useless for most cases (except special
} hacks like putting local symbols via macros into ELF segments etc.)
}
Sure, there are hacks around it. But the original statement should still
hold. If you have a static function, don't try to EXPORT_SYMBOL it out of
the file.
I prefer a mixture of both. Functions for a particular module should have
unique prefixes but, if they are only used for that module, they should
be declared static. The compiler doesn't have to optimize across files
then (hard). :)
--
|| Bill Wendling wendling@ganymede.isdn.uiuc.edu
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/