All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Buesch <mbuesch@freenet.de>
To: Jesper Juhl <juhl-lkml@dif.dk>
Cc: "Rickard E. (Rik) Faith" <faith@redhat.com>,
	Rik Faith <faith@cs.unc.edu>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Small kfree cleanup, save a local variable.
Date: Sun, 19 Jun 2005 21:37:59 +0200	[thread overview]
Message-ID: <200506192137.59719.mbuesch@freenet.de> (raw)
In-Reply-To: <Pine.LNX.4.62.0506192129300.2832@dragon.hyggekrogen.localhost>

[-- Attachment #1: Type: text/plain, Size: 1003 bytes --]

Quoting Jesper Juhl <juhl-lkml@dif.dk>:
> Here's a patch with a small improvement to kernel/auditsc.c .
> There's no need for the local variable  struct audit_entry *e  , 
> we can just call kfree directly on container_of() .

Did you look at the assembly output? Does it change?
I think the compiler optimizes this variable away, anyway.
So, if there's no improvement, I would personally prefer the
original form as it's more readable.

>  kernel/auditsc.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> --- linux-2.6.12-orig/kernel/auditsc.c	2005-06-17 21:48:29.000000000 +0200
> +++ linux-2.6.12/kernel/auditsc.c	2005-06-19 21:21:37.000000000 +0200
> @@ -202,8 +202,7 @@ static inline int audit_add_rule(struct 
>  
>  static void audit_free_rule(struct rcu_head *head)
>  {
> -	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
> -	kfree(e);
> +	kfree(container_of(head, struct audit_entry, rcu));
>  }

-- 
Greetings, Michael



[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-06-19 19:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-19 19:38 [PATCH] Small kfree cleanup, save a local variable Jesper Juhl
2005-06-19 19:37 ` Michael Buesch [this message]
2005-06-19 19:49   ` Jesper Juhl
2005-06-19 20:13 ` Chris Wright
2005-06-19 20:19   ` Jesper Juhl
2005-06-19 20:20     ` Chris Wright

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=200506192137.59719.mbuesch@freenet.de \
    --to=mbuesch@freenet.de \
    --cc=faith@cs.unc.edu \
    --cc=faith@redhat.com \
    --cc=juhl-lkml@dif.dk \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.