Commit ca6b9547 authored by Pekka Enberg's avatar Pekka Enberg Committed by Linus Torvalds

[PATCH] oprofile: minor cleanups

This patch has the following cleanups to oprofile:

  - Remove spurious casts
  - vfree() accepts NULL pointers so remove redundant test
  - The parameter for __free_cpu_buffer() is not used so merge the function
    with free_cpu_buffer()
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 86027b84
......@@ -46,7 +46,7 @@ void process_task_mortuary(void);
*/
static int task_free_notify(struct notifier_block * self, unsigned long val, void * data)
{
struct task_struct * task = (struct task_struct *)data;
struct task_struct * task = data;
spin_lock(&task_mortuary);
list_add(&task->tasks, &dying_tasks);
spin_unlock(&task_mortuary);
......
......@@ -34,13 +34,12 @@ static void wq_sync_buffer(void *);
#define DEFAULT_TIMER_EXPIRE (HZ / 10)
int work_enabled;
static void __free_cpu_buffers(int num)
void free_cpu_buffers(void)
{
int i;
for_each_online_cpu(i) {
if (cpu_buffer[i].buffer)
vfree(cpu_buffer[i].buffer);
vfree(cpu_buffer[i].buffer);
}
}
......@@ -72,17 +71,11 @@ int alloc_cpu_buffers(void)
return 0;
fail:
__free_cpu_buffers(i);
free_cpu_buffers();
return -ENOMEM;
}
void free_cpu_buffers(void)
{
__free_cpu_buffers(NR_CPUS);
}
void start_cpu_work(void)
{
int i;
......@@ -301,7 +294,7 @@ void oprofile_add_trace(unsigned long pc)
*/
static void wq_sync_buffer(void * data)
{
struct oprofile_cpu_buffer * b = (struct oprofile_cpu_buffer *)data;
struct oprofile_cpu_buffer * b = data;
if (b->cpu != smp_processor_id()) {
printk("WQ on CPU%d, prefer CPU%d\n",
smp_processor_id(), b->cpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment