Skip to content

Commit a8976fc

Browse files
mhiramatIngo Molnar
authored andcommitted
kprobes/x86: Remove addressof() operators
The following commit: 54a7d50 ("x86: mark kprobe templates as character arrays, not single characters") changed optprobe_template_* to arrays, so we can remove the addressof() operators from those symbols. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: Ananth N Mavinakayanahalli <[email protected]> Cc: Anil S Keshavamurthy <[email protected]> Cc: David S . Miller <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/150304469798.17009.15886717935027472863.stgit@devbox Signed-off-by: Ingo Molnar <[email protected]>
1 parent 63fef14 commit a8976fc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

arch/x86/include/asm/kprobes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ extern __visible kprobe_opcode_t optprobe_template_call[];
5858
extern __visible kprobe_opcode_t optprobe_template_end[];
5959
#define MAX_OPTIMIZED_LENGTH (MAX_INSN_SIZE + RELATIVE_ADDR_SIZE)
6060
#define MAX_OPTINSN_SIZE \
61-
(((unsigned long)&optprobe_template_end - \
62-
(unsigned long)&optprobe_template_entry) + \
61+
(((unsigned long)optprobe_template_end - \
62+
(unsigned long)optprobe_template_entry) + \
6363
MAX_OPTIMIZED_LENGTH + RELATIVEJUMP_SIZE)
6464

6565
extern const int kretprobe_blacklist_size;

arch/x86/kernel/kprobes/opt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ void optprobe_template_func(void);
142142
STACK_FRAME_NON_STANDARD(optprobe_template_func);
143143

144144
#define TMPL_MOVE_IDX \
145-
((long)&optprobe_template_val - (long)&optprobe_template_entry)
145+
((long)optprobe_template_val - (long)optprobe_template_entry)
146146
#define TMPL_CALL_IDX \
147-
((long)&optprobe_template_call - (long)&optprobe_template_entry)
147+
((long)optprobe_template_call - (long)optprobe_template_entry)
148148
#define TMPL_END_IDX \
149-
((long)&optprobe_template_end - (long)&optprobe_template_entry)
149+
((long)optprobe_template_end - (long)optprobe_template_entry)
150150

151151
#define INT3_SIZE sizeof(kprobe_opcode_t)
152152

@@ -371,7 +371,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op,
371371
}
372372

373373
/* Copy arch-dep-instance from template */
374-
memcpy(buf, &optprobe_template_entry, TMPL_END_IDX);
374+
memcpy(buf, optprobe_template_entry, TMPL_END_IDX);
375375

376376
/* Copy instructions into the out-of-line buffer */
377377
ret = copy_optimized_instructions(buf + TMPL_END_IDX, op->kp.addr,

0 commit comments

Comments
 (0)