aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/connector/cn_proc.c
diff options
context:
space:
mode:
authorValentin Ilie <valentin.ilie@gmail.com>2012-07-14 09:08:29 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-17 02:23:52 -0400
commitf3c48ecce56df6168be07377bf32bba88314b14c (patch)
treead84e4042379267670977d0c652d5af224d13f85 /drivers/connector/cn_proc.c
parentad8c94532acbd64e7ada25ce188befb6ef6b2027 (diff)
drivers: connector: fixed coding style issues
V2: Replaced assignment in if statement. Fixed coding style issues. Signed-off-by: Valentin Ilie <valentin.ilie@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/connector/cn_proc.c')
-rw-r--r--drivers/connector/cn_proc.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c
index 77e1e6cd66ce..3e92b7d3fcd2 100644
--- a/drivers/connector/cn_proc.c
+++ b/drivers/connector/cn_proc.c
@@ -46,7 +46,7 @@ static DEFINE_PER_CPU(__u32, proc_event_counts) = { 0 };
46static inline void get_seq(__u32 *ts, int *cpu) 46static inline void get_seq(__u32 *ts, int *cpu)
47{ 47{
48 preempt_disable(); 48 preempt_disable();
49 *ts = __this_cpu_inc_return(proc_event_counts) -1; 49 *ts = __this_cpu_inc_return(proc_event_counts) - 1;
50 *cpu = smp_processor_id(); 50 *cpu = smp_processor_id();
51 preempt_enable(); 51 preempt_enable();
52} 52}
@@ -62,8 +62,8 @@ void proc_fork_connector(struct task_struct *task)
62 if (atomic_read(&proc_event_num_listeners) < 1) 62 if (atomic_read(&proc_event_num_listeners) < 1)
63 return; 63 return;
64 64
65 msg = (struct cn_msg*)buffer; 65 msg = (struct cn_msg *)buffer;
66 ev = (struct proc_event*)msg->data; 66 ev = (struct proc_event *)msg->data;
67 get_seq(&msg->seq, &ev->cpu); 67 get_seq(&msg->seq, &ev->cpu);
68 ktime_get_ts(&ts); /* get high res monotonic timestamp */ 68 ktime_get_ts(&ts); /* get high res monotonic timestamp */
69 put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); 69 put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
@@ -93,8 +93,8 @@ void proc_exec_connector(struct task_struct *task)
93 if (atomic_read(&proc_event_num_listeners) < 1) 93 if (atomic_read(&proc_event_num_listeners) < 1)
94 return; 94 return;
95 95
96 msg = (struct cn_msg*)buffer; 96 msg = (struct cn_msg *)buffer;
97 ev = (struct proc_event*)msg->data; 97 ev = (struct proc_event *)msg->data;
98 get_seq(&msg->seq, &ev->cpu); 98 get_seq(&msg->seq, &ev->cpu);
99 ktime_get_ts(&ts); /* get high res monotonic timestamp */ 99 ktime_get_ts(&ts); /* get high res monotonic timestamp */
100 put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); 100 put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
@@ -119,8 +119,8 @@ void proc_id_connector(struct task_struct *task, int which_id)
119 if (atomic_read(&proc_event_num_listeners) < 1) 119 if (atomic_read(&proc_event_num_listeners) < 1)
120 return; 120 return;
121 121
122 msg = (struct cn_msg*)buffer; 122 msg = (struct cn_msg *)buffer;
123 ev = (struct proc_event*)msg->data; 123 ev = (struct proc_event *)msg->data;
124 ev->what = which_id; 124 ev->what = which_id;
125 ev->event_data.id.process_pid = task->pid; 125 ev->event_data.id.process_pid = task->pid;
126 ev->event_data.id.process_tgid = task->tgid; 126 ev->event_data.id.process_tgid = task->tgid;
@@ -134,7 +134,7 @@ void proc_id_connector(struct task_struct *task, int which_id)
134 ev->event_data.id.e.egid = cred->egid; 134 ev->event_data.id.e.egid = cred->egid;
135 } else { 135 } else {
136 rcu_read_unlock(); 136 rcu_read_unlock();
137 return; 137 return;
138 } 138 }
139 rcu_read_unlock(); 139 rcu_read_unlock();
140 get_seq(&msg->seq, &ev->cpu); 140 get_seq(&msg->seq, &ev->cpu);
@@ -241,8 +241,8 @@ void proc_exit_connector(struct task_struct *task)
241 if (atomic_read(&proc_event_num_listeners) < 1) 241 if (atomic_read(&proc_event_num_listeners) < 1)
242 return; 242 return;
243 243
244 msg = (struct cn_msg*)buffer; 244 msg = (struct cn_msg *)buffer;
245 ev = (struct proc_event*)msg->data; 245 ev = (struct proc_event *)msg->data;
246 get_seq(&msg->seq, &ev->cpu); 246 get_seq(&msg->seq, &ev->cpu);
247 ktime_get_ts(&ts); /* get high res monotonic timestamp */ 247 ktime_get_ts(&ts); /* get high res monotonic timestamp */
248 put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); 248 put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
@@ -276,8 +276,8 @@ static void cn_proc_ack(int err, int rcvd_seq, int rcvd_ack)
276 if (atomic_read(&proc_event_num_listeners) < 1) 276 if (atomic_read(&proc_event_num_listeners) < 1)
277 return; 277 return;
278 278
279 msg = (struct cn_msg*)buffer; 279 msg = (struct cn_msg *)buffer;
280 ev = (struct proc_event*)msg->data; 280 ev = (struct proc_event *)msg->data;
281 msg->seq = rcvd_seq; 281 msg->seq = rcvd_seq;
282 ktime_get_ts(&ts); /* get high res monotonic timestamp */ 282 ktime_get_ts(&ts); /* get high res monotonic timestamp */
283 put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); 283 put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
@@ -303,7 +303,7 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg,
303 if (msg->len != sizeof(*mc_op)) 303 if (msg->len != sizeof(*mc_op))
304 return; 304 return;
305 305
306 mc_op = (enum proc_cn_mcast_op*)msg->data; 306 mc_op = (enum proc_cn_mcast_op *)msg->data;
307 switch (*mc_op) { 307 switch (*mc_op) {
308 case PROC_CN_MCAST_LISTEN: 308 case PROC_CN_MCAST_LISTEN:
309 atomic_inc(&proc_event_num_listeners); 309 atomic_inc(&proc_event_num_listeners);
@@ -325,11 +325,11 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg,
325 */ 325 */
326static int __init cn_proc_init(void) 326static int __init cn_proc_init(void)
327{ 327{
328 int err; 328 int err = cn_add_callback(&cn_proc_event_id,
329 329 "cn_proc",
330 if ((err = cn_add_callback(&cn_proc_event_id, "cn_proc", 330 &cn_proc_mcast_ctl);
331 &cn_proc_mcast_ctl))) { 331 if (err) {
332 printk(KERN_WARNING "cn_proc failed to register\n"); 332 pr_warn("cn_proc failed to register\n");
333 return err; 333 return err;
334 } 334 }
335 return 0; 335 return 0;