aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorbibo,mao <bibo.mao@intel.com>2006-10-02 05:17:33 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-02 10:57:16 -0400
commit62c27be0dd8144e11bd3ed054a0fb890579925f8 (patch)
tree1884eaafd723059b903b81db513ca3bf5b06774b /arch/i386
parent09b18203d772db318ef92f6908c439ee5a35a4f9 (diff)
[PATCH] kprobe whitespace cleanup
Whitespace is used to indent, this patch cleans up these sentences by kernel coding style. Signed-off-by: bibo, mao <bibo.mao@intel.com> Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: "Luck, Tony" <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/kernel/kprobes.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
index afe6505ca0b..7a97544f15a 100644
--- a/arch/i386/kernel/kprobes.c
+++ b/arch/i386/kernel/kprobes.c
@@ -230,20 +230,20 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe *rp,
230 struct pt_regs *regs) 230 struct pt_regs *regs)
231{ 231{
232 unsigned long *sara = (unsigned long *)&regs->esp; 232 unsigned long *sara = (unsigned long *)&regs->esp;
233 struct kretprobe_instance *ri;
234 233
235 if ((ri = get_free_rp_inst(rp)) != NULL) { 234 struct kretprobe_instance *ri;
236 ri->rp = rp; 235
237 ri->task = current; 236 if ((ri = get_free_rp_inst(rp)) != NULL) {
237 ri->rp = rp;
238 ri->task = current;
238 ri->ret_addr = (kprobe_opcode_t *) *sara; 239 ri->ret_addr = (kprobe_opcode_t *) *sara;
239 240
240 /* Replace the return addr with trampoline addr */ 241 /* Replace the return addr with trampoline addr */
241 *sara = (unsigned long) &kretprobe_trampoline; 242 *sara = (unsigned long) &kretprobe_trampoline;
242 243 add_rp_inst(ri);
243 add_rp_inst(ri); 244 } else {
244 } else { 245 rp->nmissed++;
245 rp->nmissed++; 246 }
246 }
247} 247}
248 248
249/* 249/*
@@ -359,7 +359,7 @@ no_kprobe:
359 void __kprobes kretprobe_trampoline_holder(void) 359 void __kprobes kretprobe_trampoline_holder(void)
360 { 360 {
361 asm volatile ( ".global kretprobe_trampoline\n" 361 asm volatile ( ".global kretprobe_trampoline\n"
362 "kretprobe_trampoline: \n" 362 "kretprobe_trampoline: \n"
363 " pushf\n" 363 " pushf\n"
364 /* skip cs, eip, orig_eax, es, ds */ 364 /* skip cs, eip, orig_eax, es, ds */
365 " subl $20, %esp\n" 365 " subl $20, %esp\n"
@@ -395,14 +395,14 @@ no_kprobe:
395 */ 395 */
396fastcall void *__kprobes trampoline_handler(struct pt_regs *regs) 396fastcall void *__kprobes trampoline_handler(struct pt_regs *regs)
397{ 397{
398 struct kretprobe_instance *ri = NULL; 398 struct kretprobe_instance *ri = NULL;
399 struct hlist_head *head; 399 struct hlist_head *head;
400 struct hlist_node *node, *tmp; 400 struct hlist_node *node, *tmp;
401 unsigned long flags, orig_ret_address = 0; 401 unsigned long flags, orig_ret_address = 0;
402 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline; 402 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
403 403
404 spin_lock_irqsave(&kretprobe_lock, flags); 404 spin_lock_irqsave(&kretprobe_lock, flags);
405 head = kretprobe_inst_table_head(current); 405 head = kretprobe_inst_table_head(current);
406 406
407 /* 407 /*
408 * It is possible to have multiple instances associated with a given 408 * It is possible to have multiple instances associated with a given
@@ -413,14 +413,14 @@ fastcall void *__kprobes trampoline_handler(struct pt_regs *regs)
413 * We can handle this because: 413 * We can handle this because:
414 * - instances are always inserted at the head of the list 414 * - instances are always inserted at the head of the list
415 * - when multiple return probes are registered for the same 415 * - when multiple return probes are registered for the same
416 * function, the first instance's ret_addr will point to the 416 * function, the first instance's ret_addr will point to the
417 * real return address, and all the rest will point to 417 * real return address, and all the rest will point to
418 * kretprobe_trampoline 418 * kretprobe_trampoline
419 */ 419 */
420 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { 420 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) {
421 if (ri->task != current) 421 if (ri->task != current)
422 /* another task is sharing our hash bucket */ 422 /* another task is sharing our hash bucket */
423 continue; 423 continue;
424 424
425 if (ri->rp && ri->rp->handler){ 425 if (ri->rp && ri->rp->handler){
426 __get_cpu_var(current_kprobe) = &ri->rp->kp; 426 __get_cpu_var(current_kprobe) = &ri->rp->kp;