diff options
author | Robert Richter <robert.richter@amd.com> | 2008-10-16 09:01:40 -0400 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2008-10-16 09:01:40 -0400 |
commit | 6a18037d4165f691063b43816be3152e9006eb06 (patch) | |
tree | 61e5dab681cd0544f61b6d5ffad4c6a0c0c2b1a1 /drivers/oprofile/event_buffer.c | |
parent | 5a289395bf753f8a318d3a5fa335a757c16c0183 (diff) |
oprofile: fixing whitespaces in drivers/oprofile/*
Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'drivers/oprofile/event_buffer.c')
-rw-r--r-- | drivers/oprofile/event_buffer.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/oprofile/event_buffer.c b/drivers/oprofile/event_buffer.c index c9329f4e090f..d962ba0dd87a 100644 --- a/drivers/oprofile/event_buffer.c +++ b/drivers/oprofile/event_buffer.c | |||
@@ -19,13 +19,13 @@ | |||
19 | #include <linux/dcookies.h> | 19 | #include <linux/dcookies.h> |
20 | #include <linux/fs.h> | 20 | #include <linux/fs.h> |
21 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
22 | 22 | ||
23 | #include "oprof.h" | 23 | #include "oprof.h" |
24 | #include "event_buffer.h" | 24 | #include "event_buffer.h" |
25 | #include "oprofile_stats.h" | 25 | #include "oprofile_stats.h" |
26 | 26 | ||
27 | DEFINE_MUTEX(buffer_mutex); | 27 | DEFINE_MUTEX(buffer_mutex); |
28 | 28 | ||
29 | static unsigned long buffer_opened; | 29 | static unsigned long buffer_opened; |
30 | static DECLARE_WAIT_QUEUE_HEAD(buffer_wait); | 30 | static DECLARE_WAIT_QUEUE_HEAD(buffer_wait); |
31 | static unsigned long *event_buffer; | 31 | static unsigned long *event_buffer; |
@@ -66,7 +66,7 @@ void wake_up_buffer_waiter(void) | |||
66 | mutex_unlock(&buffer_mutex); | 66 | mutex_unlock(&buffer_mutex); |
67 | } | 67 | } |
68 | 68 | ||
69 | 69 | ||
70 | int alloc_event_buffer(void) | 70 | int alloc_event_buffer(void) |
71 | { | 71 | { |
72 | int err = -ENOMEM; | 72 | int err = -ENOMEM; |
@@ -76,13 +76,13 @@ int alloc_event_buffer(void) | |||
76 | buffer_size = fs_buffer_size; | 76 | buffer_size = fs_buffer_size; |
77 | buffer_watershed = fs_buffer_watershed; | 77 | buffer_watershed = fs_buffer_watershed; |
78 | spin_unlock_irqrestore(&oprofilefs_lock, flags); | 78 | spin_unlock_irqrestore(&oprofilefs_lock, flags); |
79 | 79 | ||
80 | if (buffer_watershed >= buffer_size) | 80 | if (buffer_watershed >= buffer_size) |
81 | return -EINVAL; | 81 | return -EINVAL; |
82 | 82 | ||
83 | event_buffer = vmalloc(sizeof(unsigned long) * buffer_size); | 83 | event_buffer = vmalloc(sizeof(unsigned long) * buffer_size); |
84 | if (!event_buffer) | 84 | if (!event_buffer) |
85 | goto out; | 85 | goto out; |
86 | 86 | ||
87 | err = 0; | 87 | err = 0; |
88 | out: | 88 | out: |
@@ -97,7 +97,7 @@ void free_event_buffer(void) | |||
97 | event_buffer = NULL; | 97 | event_buffer = NULL; |
98 | } | 98 | } |
99 | 99 | ||
100 | 100 | ||
101 | static int event_buffer_open(struct inode *inode, struct file *file) | 101 | static int event_buffer_open(struct inode *inode, struct file *file) |
102 | { | 102 | { |
103 | int err = -EPERM; | 103 | int err = -EPERM; |
@@ -116,14 +116,14 @@ static int event_buffer_open(struct inode *inode, struct file *file) | |||
116 | file->private_data = dcookie_register(); | 116 | file->private_data = dcookie_register(); |
117 | if (!file->private_data) | 117 | if (!file->private_data) |
118 | goto out; | 118 | goto out; |
119 | 119 | ||
120 | if ((err = oprofile_setup())) | 120 | if ((err = oprofile_setup())) |
121 | goto fail; | 121 | goto fail; |
122 | 122 | ||
123 | /* NB: the actual start happens from userspace | 123 | /* NB: the actual start happens from userspace |
124 | * echo 1 >/dev/oprofile/enable | 124 | * echo 1 >/dev/oprofile/enable |
125 | */ | 125 | */ |
126 | 126 | ||
127 | return 0; | 127 | return 0; |
128 | 128 | ||
129 | fail: | 129 | fail: |
@@ -172,18 +172,18 @@ static ssize_t event_buffer_read(struct file *file, char __user *buf, | |||
172 | retval = -EFAULT; | 172 | retval = -EFAULT; |
173 | 173 | ||
174 | count = buffer_pos * sizeof(unsigned long); | 174 | count = buffer_pos * sizeof(unsigned long); |
175 | 175 | ||
176 | if (copy_to_user(buf, event_buffer, count)) | 176 | if (copy_to_user(buf, event_buffer, count)) |
177 | goto out; | 177 | goto out; |
178 | 178 | ||
179 | retval = count; | 179 | retval = count; |
180 | buffer_pos = 0; | 180 | buffer_pos = 0; |
181 | 181 | ||
182 | out: | 182 | out: |
183 | mutex_unlock(&buffer_mutex); | 183 | mutex_unlock(&buffer_mutex); |
184 | return retval; | 184 | return retval; |
185 | } | 185 | } |
186 | 186 | ||
187 | const struct file_operations event_buffer_fops = { | 187 | const struct file_operations event_buffer_fops = { |
188 | .open = event_buffer_open, | 188 | .open = event_buffer_open, |
189 | .release = event_buffer_release, | 189 | .release = event_buffer_release, |