Re: [PATCH] audit: Fix compile time warning on kernel/auditsc.c

From: Valdis . Kletnieks
Date: Sat Jan 24 2009 - 22:19:00 EST


On Sat, 24 Jan 2009 01:50:30 +0600, Rakib Mullick said:
> Impact: Fix compile time warning.
>
> The function audit_set_auditable called when CONFIG_AUDIT_TREE is set.
> When CONFIG_AUDIT_TREE is not set then it might be unused, which
> generates the following warning. Making audit_set_auditable function
> inline fixes this problem. If anything else please notice.
>
> CC kernel/auditsc.o
> kernel/auditsc.c:745: warning: 'audit_set_auditable' defined but not used
>
> Thanks.
>
> Signed-off-by: Rakib Mullick <rakib.mullick@xxxxxxxxx>
>
> --- linux-2.6-orig/kernel/auditsc.c 2009-01-23 18:28:45.000000000 +0600
> +++ linux-2.6/kernel/auditsc.c 2009-01-23 22:31:34.145406088 +0600
> @@ -741,7 +741,7 @@ void audit_filter_inodes(struct task_str
> rcu_read_unlock();
> }
>
> -static void audit_set_auditable(struct audit_context *ctx)
> +static inline void audit_set_auditable(struct audit_context *ctx)

Blech. That's abuse of inline. Can you find some other, more kernel-y
way to address the issue? (Possibly make it an actual inline up in a .h
file, with a #ifdef wrapping around it, or do something matching what's
done at the call site (apparently #ifdef'ing code is accepted in that .c
file, adding another #ifdef around that function to match all the *other*
'#ifdef CONFIG_AUDIT_TREE' would be less ugly than 'inline'.

Attachment: pgp00000.pgp
Description: PGP signature