Skip to contentSkip to conversation

kprobes: remove redundant config check

PATCH In review Abhishek Sagar 3 participants 4 messages Jun 10, 2008 – Jun 11, 2008 kprobes

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kprobes: remove redundant config check

Hi,

I noticed that there's a CONFIG_KPROBES check inside kernel/kprobes.c, which seems redundant. Can be removed?

Diff'd against v2.6.26-rc5.

---
remove redundant CONFIG_KPROBES check.

kernel/kprobes.c +0 -5
index 1e0250c..2b2cae2 100644
@@ -1283,13 +1283,8 @@ EXPORT_SYMBOL_GPL(register_jprobe);
 EXPORT_SYMBOL_GPL(unregister_jprobe);
 EXPORT_SYMBOL_GPL(register_jprobes);
 EXPORT_SYMBOL_GPL(unregister_jprobes);
-#ifdef CONFIG_KPROBES
 EXPORT_SYMBOL_GPL(jprobe_return);
-#endif
-
-#ifdef CONFIG_KPROBES
 EXPORT_SYMBOL_GPL(register_kretprobe);
 EXPORT_SYMBOL_GPL(unregister_kretprobe);
 EXPORT_SYMBOL_GPL(register_kretprobes);
 EXPORT_SYMBOL_GPL(unregister_kretprobes);
-#endif
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Abhishek Sagar

Hi,

I noticed that there's a CONFIG_KPROBES check inside kernel/kprobes.c, which seems redundant. Can be removed?

Yes, it can be removed, because kernel/kprobes.c is not complied when CONFIG_KPROBES=n.

Thank you,

Quoted 5 lines

Diff'd against v2.6.26-rc5.

Signature · 7 lines
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: [email protected]
#2 lore raw
In reply to Abhishek Sagar
Quoted 20 lines · Abhishek Sagar

Hi,

I noticed that there's a CONFIG_KPROBES check inside kernel/kprobes.c, which seems redundant. Can be removed?

Diff'd against v2.6.26-rc5.

---
remove redundant CONFIG_KPROBES check.

kernel/kprobes.c +0 -0
index 1e0250c..2b2cae2 100644
@@ -1283,13 +1283,8 @@ EXPORT_SYMBOL_GPL(register_jprobe);
 EXPORT_SYMBOL_GPL(unregister_jprobe);
 EXPORT_SYMBOL_GPL(register_jprobes);
 EXPORT_SYMBOL_GPL(unregister_jprobes);

kernel/kprobes.c EXPORT_SYMBOL_GPL(register_jprobe); · line 1295

Quoted 10 lines
kernel/kprobes.c +0 -5
-#ifdef CONFIG_KPROBES
 EXPORT_SYMBOL_GPL(jprobe_return);
-#endif
-
-#ifdef CONFIG_KPROBES
 EXPORT_SYMBOL_GPL(register_kretprobe);
 EXPORT_SYMBOL_GPL(unregister_kretprobe);
 EXPORT_SYMBOL_GPL(register_kretprobes);
 EXPORT_SYMBOL_GPL(unregister_kretprobes);
-#endif

Abhishek,

This was intentional (to take care of some gcc 4.2 issues). See commit cd5bfea278987ebfe60f3ff92a01696b17c4f978 (fix compilation with gcc 4.2) from Peter Chubb for details.

Ananth

#3 lore raw
Quoted 5 lines · Ananth N Mavinakayanahalli

Abhishek,

This was intentional (to take care of some gcc 4.2 issues). See commit cd5bfea278987ebfe60f3ff92a01696b17c4f978 (fix compilation with gcc 4.2) from Peter Chubb for details.

Yea, I checked it out and the problem the commit seems to be fixing is that EXPORT_SYMBOL complains for static symbols with gcc-4.2. Can't see why there was a need to cram CONFIG_KPROBES inside kprobes.c. This check was sneaked in defensively it seems, and is unnecessary.

--
Regards,
Abhishek Sagar