From 21a62c559ed8f3d4153e224b5445f7d42e99a38d Mon Sep 17 00:00:00 2001 From: Jesper Nilsson Date: Wed, 4 Aug 2010 11:44:08 +0200 Subject: [PATCH] --- yaml --- r: 207153 b: refs/heads/master c: c1c8f558749cbf2a7ed16b6ae6e19a4238b6fa33 h: refs/heads/master i: 207151: a7bd46e5b9d24274e0f1942293f5e67b8d5dfc95 v: v3 --- [refs] | 2 +- trunk/arch/cris/kernel/profile.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index a7bfecfe8534..4560956bf5b4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 72e08db187cbbfca00583c28b64ae81a35f4a287 +refs/heads/master: c1c8f558749cbf2a7ed16b6ae6e19a4238b6fa33 diff --git a/trunk/arch/cris/kernel/profile.c b/trunk/arch/cris/kernel/profile.c index b917549a7d94..195ec5fa0dd2 100644 --- a/trunk/arch/cris/kernel/profile.c +++ b/trunk/arch/cris/kernel/profile.c @@ -9,12 +9,11 @@ #define SAMPLE_BUFFER_SIZE 8192 -static char* sample_buffer; -static char* sample_buffer_pos; +static char *sample_buffer; +static char *sample_buffer_pos; static int prof_running = 0; -void -cris_profile_sample(struct pt_regs* regs) +void cris_profile_sample(struct pt_regs *regs) { if (!prof_running) return; @@ -24,7 +23,7 @@ cris_profile_sample(struct pt_regs* regs) else *(unsigned int*)sample_buffer_pos = 0; - *(unsigned int*)(sample_buffer_pos + 4) = instruction_pointer(regs); + *(unsigned int *)(sample_buffer_pos + 4) = instruction_pointer(regs); sample_buffer_pos += 8; if (sample_buffer_pos == sample_buffer + SAMPLE_BUFFER_SIZE) @@ -54,6 +53,7 @@ write_cris_profile(struct file *file, const char __user *buf, { sample_buffer_pos = sample_buffer; memset(sample_buffer, 0, SAMPLE_BUFFER_SIZE); + return count < SAMPLE_BUFFER_SIZE ? count : SAMPLE_BUFFER_SIZE; } static const struct file_operations cris_proc_profile_operations = { @@ -61,8 +61,7 @@ static const struct file_operations cris_proc_profile_operations = { .write = write_cris_profile, }; -static int -__init init_cris_profile(void) +static int __init init_cris_profile(void) { struct proc_dir_entry *entry; @@ -82,5 +81,5 @@ __init init_cris_profile(void) return 0; } - __initcall(init_cris_profile); +