mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Rakib Mullick <rakib.mullick@gmail.com>
Cc: "Valdis.Kletnieks@vt.edu" <Valdis.Kletnieks@vt.edu>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] audit: Fix compile time warning on kernel/auditsc.c
Date: Mon, 26 Jan 2009 14:38:54 +0100	[thread overview]
Message-ID: <20090126133854.GA18859@elte.hu> (raw)
In-Reply-To: <b9df5fa10901242201h75f40e40ic27dfb089dd90fc8@mail.gmail.com>


* Rakib Mullick <rakib.mullick@gmail.com> wrote:

> On 1/25/09, Valdis.Kletnieks@vt.edu <Valdis.Kletnieks@vt.edu> wrote:
> >
> > 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'.
> 
> Hi, Valdis. Thanks for your suggestions. Actually without inline-ing
> the warning doesn't resolves. So, as you said I moved
> audit_set_auditable function into kernel/audit.h, but not #ifdef
> wrapping around it rather #ifdef into it. Since wrapping #ifdef
> generates same warning few times more. Here is the patch. If I miss
> anything, then please notice.
> 
> -----
> Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
> 
> --- linux-2.6-orig/kernel/audit.h	2009-01-23 18:28:45.000000000 +0600
> +++ linux-2.6/kernel/audit.h	2009-01-25 11:50:22.520217272 +0600
> @@ -121,6 +121,16 @@ extern struct mutex audit_filter_mutex;
>  extern void audit_free_rule_rcu(struct rcu_head *);
>  extern struct list_head audit_filter_list[];
> 
> +static inline void audit_set_auditable(struct audit_context *ctx)
> +{
> +#ifdef CONFIG_AUDIT_TREE
> +	if (!ctx->prio) {
> +		ctx->prio = 1;
> +		ctx->current_state = AUDIT_RECORD_CONTEXT;
> +	}
> +#endif
> +}
> +
>  #ifdef CONFIG_AUDIT_TREE
>  extern struct audit_chunk *audit_tree_lookup(const struct inode *);
>  extern void audit_put_chunk(struct audit_chunk *);
> 
> ------
> Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
> 
> --- linux-2.6-orig/kernel/auditsc.c	2009-01-23 18:28:45.000000000 +0600
> +++ linux-2.6/kernel/auditsc.c	2009-01-25 11:50:25.712731936 +0600
> @@ -741,14 +741,6 @@ void audit_filter_inodes(struct task_str
>  	rcu_read_unlock();
>  }
> 
> -static void audit_set_auditable(struct audit_context *ctx)
> -{
> -	if (!ctx->prio) {
> -		ctx->prio = 1;
> -		ctx->current_state = AUDIT_RECORD_CONTEXT;
> -	}
> -}
> -

i dont see how this is an improvement in code quality. A non-oneliner 
function got inlined and an ugly #ifdef got added.

	Ingo

  reply	other threads:[~2009-01-26 13:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-23 19:50 Rakib Mullick
2009-01-25  3:18 ` Valdis.Kletnieks
2009-01-25  6:01   ` Rakib Mullick
2009-01-26 13:38     ` Ingo Molnar [this message]
2009-01-28  1:18       ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090126133854.GA18859@elte.hu \
    --to=mingo@elte.hu \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rakib.mullick@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®