Skip to content

Commit

Permalink
auditsc: remove audit_set_context() altogether - fold it into its caller
Browse files Browse the repository at this point in the history
>   In function audit_alloc_context(), use kzalloc, instead of kmalloc+memset. Patch also renames audit_zero_context() to
> audit_set_context(), to represent it's inner workings properly.

Fair enough.  I'd go futher...

Cc: Al Viro <[email protected]>
Cc: Eric Paris <[email protected]>
Cc: Rakib Mullick <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Eric Paris <[email protected]>
  • Loading branch information
akpm00 authored and eparis committed Apr 10, 2013
1 parent 17c6ee7 commit e2c5adc
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions kernel/auditsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1048,21 +1048,15 @@ static inline void audit_free_aux(struct audit_context *context)
}
}

static inline void audit_set_context(struct audit_context *context,
enum audit_state state)
{
context->state = state;
context->prio = state == AUDIT_RECORD_CONTEXT ? ~0ULL : 0;
}

static inline struct audit_context *audit_alloc_context(enum audit_state state)
{
struct audit_context *context;

context = kzalloc(sizeof(*context), GFP_KERNEL);
if (!context)
return NULL;
audit_set_context(context, state);
context->state = state;
context->prio = state == AUDIT_RECORD_CONTEXT ? ~0ULL : 0;
INIT_LIST_HEAD(&context->killed_trees);
INIT_LIST_HEAD(&context->names_list);
return context;
Expand Down

0 comments on commit e2c5adc

Please sign in to comment.