aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorSrikar Dronamraju <srikar@linux.vnet.ibm.com>2012-03-12 05:25:30 -0400
committerIngo Molnar <mingo@elte.hu>2012-03-13 01:22:20 -0400
commite3343e6a2819ff5d0dfc4bb5c9fb7f9a4d04da73 (patch)
tree4c391fa0cb4408e9fb2e8448c410fc54b9a8abe1 /arch/x86/kernel
parent900771a483ef28915a48066d7895d8252315607a (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/kernel')
-rw-r--r--arch/x86/kernel/uprobes.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
index 6dfa89e6f24..851a11b0d38 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 */
300static void handle_riprel_insn(struct mm_struct *mm, struct arch_uprobe *auprobe, struct insn *insn) 300static void
301handle_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
384static int validate_insn_bits(struct mm_struct *mm, struct arch_uprobe *auprobe, struct insn *insn) 385static 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: */
391static void handle_riprel_insn(struct mm_struct *mm, struct arch_uprobe *auprobe, struct insn *insn) 392static 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
396static int validate_insn_bits(struct mm_struct *mm, struct arch_uprobe *auprobe, struct insn *insn) 397static 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 */
408int arch_uprobes_analyze_insn(struct mm_struct *mm, struct arch_uprobe *auprobe) 409int 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;