* [SELINUX] mark avc_init with __init
@ 2004-02-13 14:23 James Morris
2004-02-13 19:12 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: James Morris @ 2004-02-13 14:23 UTC (permalink / raw)
To: Andrew Morton; +Cc: Stephen Smalley, linux-kernel
The avc_init function is only called during kernel init, so it can be
marked with __init.
Please apply.
- James
--
James Morris
<jmorris@redhat.com>
diff -urN -X dontdiff linux-2.6.3-rc2-mm1.o/security/selinux/avc.c linux-2.6.3-rc2-mm1.w2/security/selinux/avc.c
--- linux-2.6.3-rc2-mm1.o/security/selinux/avc.c 2004-02-04 08:39:07.000000000 -0500
+++ linux-2.6.3-rc2-mm1.w2/security/selinux/avc.c 2004-02-13 09:21:38.703303568 -0500
@@ -166,7 +166,7 @@
*
* Initialize the access vector cache.
*/
-void avc_init(void)
+void __init avc_init(void)
{
struct avc_node *new;
int i;
diff -urN -X dontdiff linux-2.6.3-rc2-mm1.o/security/selinux/include/avc.h linux-2.6.3-rc2-mm1.w2/security/selinux/include/avc.h
--- linux-2.6.3-rc2-mm1.o/security/selinux/include/avc.h 2004-02-04 08:39:07.000000000 -0500
+++ linux-2.6.3-rc2-mm1.w2/security/selinux/include/avc.h 2004-02-13 09:21:38.704303416 -0500
@@ -11,6 +11,7 @@
#include <linux/kernel.h>
#include <linux/kdev_t.h>
#include <linux/spinlock.h>
+#include <linux/init.h>
#include <asm/system.h>
#include "flask.h"
#include "av_permissions.h"
@@ -121,7 +122,7 @@
* AVC operations
*/
-void avc_init(void);
+void __init avc_init(void);
int avc_lookup(u32 ssid, u32 tsid, u16 tclass,
u32 requested, struct avc_entry_ref *aeref);
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [SELINUX] mark avc_init with __init
2004-02-13 14:23 [SELINUX] mark avc_init with __init James Morris
@ 2004-02-13 19:12 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2004-02-13 19:12 UTC (permalink / raw)
To: James Morris; +Cc: sds, linux-kernel
James Morris <jmorris@redhat.com> wrote:
>
> The avc_init function is only called during kernel init, so it can be
> marked with __init.
>
> ...
> --- linux-2.6.3-rc2-mm1.o/security/selinux/include/avc.h 2004-02-04 08:39:07.000000000 -0500
> +++ linux-2.6.3-rc2-mm1.w2/security/selinux/include/avc.h 2004-02-13 09:21:38.704303416 -0500
> @@ -11,6 +11,7 @@
> #include <linux/kernel.h>
> #include <linux/kdev_t.h>
> #include <linux/spinlock.h>
> +#include <linux/init.h>
> #include <asm/system.h>
> #include "flask.h"
> #include "av_permissions.h"
> @@ -121,7 +122,7 @@
> * AVC operations
> */
>
> -void avc_init(void);
> +void __init avc_init(void);
>
The section specifier only needs to be at the definition site, not at the
declaration site. I guess it adds a little value for the header fle to say
"hey, this is __init", but as nothing checks that at runtime or compile
time it can easily become stale.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-02-13 19:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-13 14:23 [SELINUX] mark avc_init with __init James Morris
2004-02-13 19:12 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®