diff options
author | Srikar Dronamraju <srikar@linux.vnet.ibm.com> | 2012-03-12 05:25:30 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2012-03-13 01:22:20 -0400 |
commit | e3343e6a2819ff5d0dfc4bb5c9fb7f9a4d04da73 (patch) | |
tree | 4c391fa0cb4408e9fb2e8448c410fc54b9a8abe1 /arch/x86 | |
parent | 900771a483ef28915a48066d7895d8252315607a (diff) |
uprobes/core: Make order of function parameters consistent across functions
If a function takes struct uprobe or struct arch_uprobe, then it
is passed as the first parameter.
This is pure cleanup, no functional change intended.
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com>
Cc: Linux-mm <linux-mm@kvack.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20120312092530.5379.18394.sendpatchset@srdronam.in.ibm.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/uprobes.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/uprobes.c | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/arch/x86/include/asm/uprobes.h b/arch/x86/include/asm/uprobes.h index 5c399e446512..384f1bebf884 100644 --- a/arch/x86/include/asm/uprobes.h +++ b/arch/x86/include/asm/uprobes.h | |||
@@ -39,5 +39,5 @@ struct arch_uprobe { | |||
39 | #endif | 39 | #endif |
40 | }; | 40 | }; |
41 | 41 | ||
42 | extern int arch_uprobes_analyze_insn(struct mm_struct *mm, struct arch_uprobe *arch_uprobe); | 42 | extern int arch_uprobes_analyze_insn(struct arch_uprobe *aup, struct mm_struct *mm); |
43 | #endif /* _ASM_UPROBES_H */ | 43 | #endif /* _ASM_UPROBES_H */ |
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c index 6dfa89e6f24a..851a11b0d38c 100644 --- a/arch/x86/kernel/uprobes.c +++ b/arch/x86/kernel/uprobes.c | |||
@@ -297,7 +297,8 @@ static void prepare_fixups(struct arch_uprobe *auprobe, struct insn *insn) | |||
297 | * - There's never a SIB byte. | 297 | * - There's never a SIB byte. |
298 | * - The displacement is always 4 bytes. | 298 | * - The displacement is always 4 bytes. |
299 | */ | 299 | */ |
300 | static void handle_riprel_insn(struct mm_struct *mm, struct arch_uprobe *auprobe, struct insn *insn) | 300 | static void |
301 | handle_riprel_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, struct insn *insn) | ||
301 | { | 302 | { |
302 | u8 *cursor; | 303 | u8 *cursor; |
303 | u8 reg; | 304 | u8 reg; |
@@ -381,19 +382,19 @@ static int validate_insn_64bits(struct arch_uprobe *auprobe, struct insn *insn) | |||
381 | return -ENOTSUPP; | 382 | return -ENOTSUPP; |
382 | } | 383 | } |
383 | 384 | ||
384 | static int validate_insn_bits(struct mm_struct *mm, struct arch_uprobe *auprobe, struct insn *insn) | 385 | static int validate_insn_bits(struct arch_uprobe *auprobe, struct mm_struct *mm, struct insn *insn) |
385 | { | 386 | { |
386 | if (mm->context.ia32_compat) | 387 | if (mm->context.ia32_compat) |
387 | return validate_insn_32bits(auprobe, insn); | 388 | return validate_insn_32bits(auprobe, insn); |
388 | return validate_insn_64bits(auprobe, insn); | 389 | return validate_insn_64bits(auprobe, insn); |
389 | } | 390 | } |
390 | #else /* 32-bit: */ | 391 | #else /* 32-bit: */ |
391 | static void handle_riprel_insn(struct mm_struct *mm, struct arch_uprobe *auprobe, struct insn *insn) | 392 | static void handle_riprel_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, struct insn *insn) |
392 | { | 393 | { |
393 | /* No RIP-relative addressing on 32-bit */ | 394 | /* No RIP-relative addressing on 32-bit */ |
394 | } | 395 | } |
395 | 396 | ||
396 | static int validate_insn_bits(struct mm_struct *mm, struct arch_uprobe *auprobe, struct insn *insn) | 397 | static int validate_insn_bits(struct arch_uprobe *auprobe, struct mm_struct *mm, struct insn *insn) |
397 | { | 398 | { |
398 | return validate_insn_32bits(auprobe, insn); | 399 | return validate_insn_32bits(auprobe, insn); |
399 | } | 400 | } |
@@ -405,17 +406,17 @@ static int validate_insn_bits(struct mm_struct *mm, struct arch_uprobe *auprobe, | |||
405 | * @arch_uprobe: the probepoint information. | 406 | * @arch_uprobe: the probepoint information. |
406 | * Return 0 on success or a -ve number on error. | 407 | * Return 0 on success or a -ve number on error. |
407 | */ | 408 | */ |
408 | int arch_uprobes_analyze_insn(struct mm_struct *mm, struct arch_uprobe *auprobe) | 409 | int arch_uprobes_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm) |
409 | { | 410 | { |
410 | int ret; | 411 | int ret; |
411 | struct insn insn; | 412 | struct insn insn; |
412 | 413 | ||
413 | auprobe->fixups = 0; | 414 | auprobe->fixups = 0; |
414 | ret = validate_insn_bits(mm, auprobe, &insn); | 415 | ret = validate_insn_bits(auprobe, mm, &insn); |
415 | if (ret != 0) | 416 | if (ret != 0) |
416 | return ret; | 417 | return ret; |
417 | 418 | ||
418 | handle_riprel_insn(mm, auprobe, &insn); | 419 | handle_riprel_insn(auprobe, mm, &insn); |
419 | prepare_fixups(auprobe, &insn); | 420 | prepare_fixups(auprobe, &insn); |
420 | 421 | ||
421 | return 0; | 422 | return 0; |