Commit c1c8f558 authored by Jesper Nilsson's avatar Jesper Nilsson

CRIS: Return something from profile write

Even if it doesn't matter, we should return something.
Also, clean up some formatting.
Signed-off-by: default avatarJesper Nilsson <jesper.nilsson@axis.com>
parent 72e08db1
...@@ -9,12 +9,11 @@ ...@@ -9,12 +9,11 @@
#define SAMPLE_BUFFER_SIZE 8192 #define SAMPLE_BUFFER_SIZE 8192
static char* sample_buffer; static char *sample_buffer;
static char* sample_buffer_pos; static char *sample_buffer_pos;
static int prof_running = 0; static int prof_running = 0;
void void cris_profile_sample(struct pt_regs *regs)
cris_profile_sample(struct pt_regs* regs)
{ {
if (!prof_running) if (!prof_running)
return; return;
...@@ -24,7 +23,7 @@ cris_profile_sample(struct pt_regs* regs) ...@@ -24,7 +23,7 @@ cris_profile_sample(struct pt_regs* regs)
else else
*(unsigned int*)sample_buffer_pos = 0; *(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; sample_buffer_pos += 8;
if (sample_buffer_pos == sample_buffer + SAMPLE_BUFFER_SIZE) if (sample_buffer_pos == sample_buffer + SAMPLE_BUFFER_SIZE)
...@@ -54,6 +53,7 @@ write_cris_profile(struct file *file, const char __user *buf, ...@@ -54,6 +53,7 @@ write_cris_profile(struct file *file, const char __user *buf,
{ {
sample_buffer_pos = sample_buffer; sample_buffer_pos = sample_buffer;
memset(sample_buffer, 0, SAMPLE_BUFFER_SIZE); 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 = { static const struct file_operations cris_proc_profile_operations = {
...@@ -61,8 +61,7 @@ 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, .write = write_cris_profile,
}; };
static int static int __init init_cris_profile(void)
__init init_cris_profile(void)
{ {
struct proc_dir_entry *entry; struct proc_dir_entry *entry;
...@@ -82,5 +81,5 @@ __init init_cris_profile(void) ...@@ -82,5 +81,5 @@ __init init_cris_profile(void)
return 0; return 0;
} }
__initcall(init_cris_profile); __initcall(init_cris_profile);
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