aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2010-08-04 05:44:08 -0400
committerJesper Nilsson <jesper.nilsson@axis.com>2010-08-04 07:02:40 -0400
commitc1c8f558749cbf2a7ed16b6ae6e19a4238b6fa33 (patch)
treeb329939fdc5347532cb44261892914493d27e64e /arch
parent72e08db187cbbfca00583c28b64ae81a35f4a287 (diff)
CRIS: Return something from profile write
Even if it doesn't matter, we should return something. Also, clean up some formatting. Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/cris/kernel/profile.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/cris/kernel/profile.c b/arch/cris/kernel/profile.c
index b917549a7d94..195ec5fa0dd2 100644
--- a/arch/cris/kernel/profile.c
+++ b/arch/cris/kernel/profile.c
@@ -9,12 +9,11 @@
9 9
10#define SAMPLE_BUFFER_SIZE 8192 10#define SAMPLE_BUFFER_SIZE 8192
11 11
12static char* sample_buffer; 12static char *sample_buffer;
13static char* sample_buffer_pos; 13static char *sample_buffer_pos;
14static int prof_running = 0; 14static int prof_running = 0;
15 15
16void 16void cris_profile_sample(struct pt_regs *regs)
17cris_profile_sample(struct pt_regs* regs)
18{ 17{
19 if (!prof_running) 18 if (!prof_running)
20 return; 19 return;
@@ -24,7 +23,7 @@ cris_profile_sample(struct pt_regs* regs)
24 else 23 else
25 *(unsigned int*)sample_buffer_pos = 0; 24 *(unsigned int*)sample_buffer_pos = 0;
26 25
27 *(unsigned int*)(sample_buffer_pos + 4) = instruction_pointer(regs); 26 *(unsigned int *)(sample_buffer_pos + 4) = instruction_pointer(regs);
28 sample_buffer_pos += 8; 27 sample_buffer_pos += 8;
29 28
30 if (sample_buffer_pos == sample_buffer + SAMPLE_BUFFER_SIZE) 29 if (sample_buffer_pos == sample_buffer + SAMPLE_BUFFER_SIZE)
@@ -54,6 +53,7 @@ write_cris_profile(struct file *file, const char __user *buf,
54{ 53{
55 sample_buffer_pos = sample_buffer; 54 sample_buffer_pos = sample_buffer;
56 memset(sample_buffer, 0, SAMPLE_BUFFER_SIZE); 55 memset(sample_buffer, 0, SAMPLE_BUFFER_SIZE);
56 return count < SAMPLE_BUFFER_SIZE ? count : SAMPLE_BUFFER_SIZE;
57} 57}
58 58
59static const struct file_operations cris_proc_profile_operations = { 59static const struct file_operations cris_proc_profile_operations = {
@@ -61,8 +61,7 @@ static const struct file_operations cris_proc_profile_operations = {
61 .write = write_cris_profile, 61 .write = write_cris_profile,
62}; 62};
63 63
64static int 64static int __init init_cris_profile(void)
65__init init_cris_profile(void)
66{ 65{
67 struct proc_dir_entry *entry; 66 struct proc_dir_entry *entry;
68 67
@@ -82,5 +81,5 @@ __init init_cris_profile(void)
82 81
83 return 0; 82 return 0;
84} 83}
85
86__initcall(init_cris_profile); 84__initcall(init_cris_profile);
85