Commit c1c8f558749cbf2a7ed16b6ae6e19a4238b6fa33
1 parent
72e08db187
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 7 additions and 8 deletions Side-by-side Diff
arch/cris/kernel/profile.c
... | ... | @@ -9,12 +9,11 @@ |
9 | 9 | |
10 | 10 | #define SAMPLE_BUFFER_SIZE 8192 |
11 | 11 | |
12 | -static char* sample_buffer; | |
13 | -static char* sample_buffer_pos; | |
12 | +static char *sample_buffer; | |
13 | +static char *sample_buffer_pos; | |
14 | 14 | static int prof_running = 0; |
15 | 15 | |
16 | -void | |
17 | -cris_profile_sample(struct pt_regs* regs) | |
16 | +void cris_profile_sample(struct pt_regs *regs) | |
18 | 17 | { |
19 | 18 | if (!prof_running) |
20 | 19 | return; |
... | ... | @@ -24,7 +23,7 @@ |
24 | 23 | else |
25 | 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 | 27 | sample_buffer_pos += 8; |
29 | 28 | |
30 | 29 | if (sample_buffer_pos == sample_buffer + SAMPLE_BUFFER_SIZE) |
... | ... | @@ -54,6 +53,7 @@ |
54 | 53 | { |
55 | 54 | sample_buffer_pos = sample_buffer; |
56 | 55 | memset(sample_buffer, 0, SAMPLE_BUFFER_SIZE); |
56 | + return count < SAMPLE_BUFFER_SIZE ? count : SAMPLE_BUFFER_SIZE; | |
57 | 57 | } |
58 | 58 | |
59 | 59 | static const struct file_operations cris_proc_profile_operations = { |
... | ... | @@ -61,8 +61,7 @@ |
61 | 61 | .write = write_cris_profile, |
62 | 62 | }; |
63 | 63 | |
64 | -static int | |
65 | -__init init_cris_profile(void) | |
64 | +static int __init init_cris_profile(void) | |
66 | 65 | { |
67 | 66 | struct proc_dir_entry *entry; |
68 | 67 | |
... | ... | @@ -82,6 +81,5 @@ |
82 | 81 | |
83 | 82 | return 0; |
84 | 83 | } |
85 | - | |
86 | 84 | __initcall(init_cris_profile); |