Quoting Jesper Juhl <[email protected]>: > 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:
pgpSlHMgyAfGv.pgp
Description: PGP signature
- Follow-Ups:
- Re: [PATCH] Small kfree cleanup, save a local variable.
- From: Jesper Juhl <[email protected]>
- Re: [PATCH] Small kfree cleanup, save a local variable.
- References:
- [PATCH] Small kfree cleanup, save a local variable.
- From: Jesper Juhl <[email protected]>
- [PATCH] Small kfree cleanup, save a local variable.
- Prev by Date: [PATCH] modules, small codingstyle cleanup, one statement/expression pr line
- Next by Date: Re: [PATCH] Small kfree cleanup, save a local variable.
- Previous by thread: [PATCH] Small kfree cleanup, save a local variable.
- Next by thread: Re: [PATCH] Small kfree cleanup, save a local variable.
- Index(es):