[PATCH 2/2] audit: remove unnecessary #if CONFIG_AUDIT

Andrew Morton akpm at linux-foundation.org
Mon Apr 15 21:02:30 UTC 2013


On Fri, 12 Apr 2013 17:34:21 +0800 Gao feng <gaofeng at cn.fujitsu.com> wrote:

> The files include kernel/audit.h are complied only
> when CONFIG_AUDIT is set.
> 
> Just like audit_pid,there is no need to surround
> audit_ever_enabled with CONFIG_AUDIT.
> 
> Signed-off-by: Gao feng <gaofeng at cn.fujitsu.com>
> ---
>  kernel/audit.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/kernel/audit.h b/kernel/audit.h
> index d06ffc1..11468d9 100644
> --- a/kernel/audit.h
> +++ b/kernel/audit.h
> @@ -59,9 +59,7 @@ struct audit_entry {
>  	struct audit_krule	rule;
>  };
>  
> -#ifdef CONFIG_AUDIT
>  extern int audit_ever_enabled;
> -#endif
>  
>  extern int audit_pid;

Well actually there's no need to put the ifdefs around such an extern
declaration at all.  The one small downside to omitting the ifdefs is
that a programming mistake may then be revealed at link-time instead of
at compile-time.  But we very often omit the ifdefs, because reducing visual
clutter is more important.





More information about the Linux-audit mailing list