Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: kprobes: __kprobes annotations and formatting cleanups.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+20 -17
+20 -17
arch/sh/kernel/kprobes.c
··· 115 115 } 116 116 } 117 117 118 - static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) 118 + static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) 119 119 { 120 120 kcb->prev_kprobe.kp = kprobe_running(); 121 121 kcb->prev_kprobe.status = kcb->kprobe_status; 122 122 } 123 123 124 - static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) 124 + static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) 125 125 { 126 126 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; 127 127 kcb->kprobe_status = kcb->prev_kprobe.status; 128 128 } 129 129 130 - static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, 131 - struct kprobe_ctlblk *kcb) 130 + static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs, 131 + struct kprobe_ctlblk *kcb) 132 132 { 133 133 __get_cpu_var(current_kprobe) = p; 134 134 } ··· 138 138 * on the next instruction, following branches. Two probes are set if the 139 139 * branch is conditional. 140 140 */ 141 - static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 141 + static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 142 142 { 143 143 kprobe_opcode_t *addr = NULL; 144 144 saved_current_opcode.addr = (kprobe_opcode_t *) (regs->pc); ··· 273 273 /* handler has already set things up, so skip ss setup */ 274 274 return 1; 275 275 276 - ss_probe: 276 + ss_probe: 277 277 prepare_singlestep(p, regs); 278 278 kcb->kprobe_status = KPROBE_HIT_SS; 279 279 return 1; 280 280 281 - no_kprobe: 281 + no_kprobe: 282 282 preempt_enable_no_resched(); 283 283 return ret; 284 284 } ··· 358 358 return orig_ret_address; 359 359 } 360 360 361 - static inline int post_kprobe_handler(struct pt_regs *regs) 361 + static int __kprobes post_kprobe_handler(struct pt_regs *regs) 362 362 { 363 363 struct kprobe *cur = kprobe_running(); 364 364 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); ··· 391 391 } 392 392 } 393 393 394 - /*Restore back the original saved kprobes variables and continue. */ 394 + /* Restore back the original saved kprobes variables and continue. */ 395 395 if (kcb->kprobe_status == KPROBE_REENTER) { 396 396 restore_previous_kprobe(kcb); 397 397 goto out; 398 398 } 399 + 399 400 reset_current_kprobe(); 400 401 401 - out: 402 + out: 402 403 preempt_enable_no_resched(); 403 404 404 405 return 1; ··· 464 463 default: 465 464 break; 466 465 } 466 + 467 467 return 0; 468 468 } 469 469 ··· 500 498 ret = NOTIFY_STOP; 501 499 } else { 502 500 p = __get_cpu_var(current_kprobe); 503 - if (p->break_handler 504 - && p->break_handler(p, args->regs)) 501 + if (p->break_handler && 502 + p->break_handler(p, args->regs)) 505 503 ret = NOTIFY_STOP; 506 504 } 507 505 } ··· 544 542 int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) 545 543 { 546 544 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 547 - u8 *addr = (u8 *) regs->pc; 548 545 unsigned long stack_addr = kcb->jprobe_saved_r15; 546 + u8 *addr = (u8 *)regs->pc; 549 547 550 - if ((addr >= (u8 *) jprobe_return) 551 - && (addr <= (u8 *) jprobe_return_end)) { 548 + if ((addr >= (u8 *)jprobe_return) && 549 + (addr <= (u8 *)jprobe_return_end)) { 552 550 *regs = kcb->jprobe_saved_regs; 553 551 554 - memcpy((kprobe_opcode_t *) stack_addr, kcb->jprobes_stack, 552 + memcpy((kprobe_opcode_t *)stack_addr, kcb->jprobes_stack, 555 553 MIN_STACK_SIZE(stack_addr)); 556 554 557 555 kcb->kprobe_status = KPROBE_HIT_SS; 558 556 preempt_enable_no_resched(); 559 557 return 1; 560 558 } 559 + 561 560 return 0; 562 561 } 563 562 564 563 static struct kprobe trampoline_p = { 565 - .addr = (kprobe_opcode_t *) &kretprobe_trampoline, 564 + .addr = (kprobe_opcode_t *)&kretprobe_trampoline, 566 565 .pre_handler = trampoline_probe_handler 567 566 }; 568 567