public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Mitchell Blank Jr <mitch@sfgoth.com>
To: Steve Grubb <sgrubb@redhat.com>
Cc: linux-audit@redhat.com
Subject: Re: [PATCH] [AUDIT] auditfilter.c cleanup/const-ification
Date: Mon, 3 Apr 2006 16:46:24 -0700	[thread overview]
Message-ID: <20060403234624.GH3157@gaz.sfgoth.com> (raw)
In-Reply-To: <200604031656.05141.sgrubb@redhat.com>

Steve Grubb wrote:
> These are good cleanups. In a way, I wished this was 2 patches instead of 1. 

Yeah, sorry. I got a little carried away I guess.  I can split them if that
helps.

> The other one I'd probably want to 
> put in the test kernel for a week or two just to make sure nothing relied on 
> the state.

It's pretty clear from inspection.  Look:

| static int audit_filter_user_rules(struct netlink_skb_parms *cb,
|                                    struct audit_krule *rule,
|                                    enum audit_state *state)

OK, so it's a static function... and it has only one caller, where:

|       enum audit_state   state;
[...]
|	if (audit_filter_user_rules(cb, &e->rule, &state)) {
|                        if (state == AUDIT_DISABLED)
|	                                ret = 0;

That's all the code that looks at "state".  It's never stored anywhere;
it's just lost after that test.

The only other possibility where it could be used is if
audit_filter_user_rules() were relying on it to be stable each time its run
but that's clearly not the case because audit_filter_user_rules() only writes
to "*state"; it never reads from it.

So I'm pretty confident that this is a safe cleanup.

-Mitch

  reply	other threads:[~2006-04-03 23:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-03 12:51 [PATCH] [AUDIT] auditfilter.c cleanup/const-ification Mitchell Blank Jr
2006-04-03 20:56 ` Steve Grubb
2006-04-03 23:46   ` Mitchell Blank Jr [this message]
2006-04-04 14:37 ` Amy Griffis
2006-04-05 11:41   ` Mitchell Blank Jr
2006-04-05 12:29     ` Steve Grubb
2006-04-05 13:50       ` Mitchell Blank Jr
2006-04-06 13:43         ` Mitchell Blank Jr
2006-04-06 15:41           ` Alexander Viro
2006-04-05 13:30     ` Amy Griffis

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=20060403234624.GH3157@gaz.sfgoth.com \
    --to=mitch@sfgoth.com \
    --cc=linux-audit@redhat.com \
    --cc=sgrubb@redhat.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