Re: [SELINUX] mark avc_init with __init

From: Andrew Morton
Date: Fri Feb 13 2004 - 14:13:29 EST


James Morris <jmorris@xxxxxxxxxx> 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.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/