Skip to contentSkip to conversation

Kprobes: Make kprobe.symbol_name const

PATCH In review Ananth N Mavinakayanahalli 2 participants 2 messages Mar 15, 2007 kprobes

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Kprobes: Make kprobe.symbol_name const

From: Ananth N Mavinakayanahalli <[email protected]>

Kprobes doesn't scribble the kprobe.symbol_name field. Its only set by the module when registering the probe. Modules that exercise good hygiene using the "const" qualifier will see warnings...

warning: assignment discards qualifiers from pointer target type

Make struct kprobe.symbol_name const char *

---
 include/linux/kprobes.h |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
include/linux/kprobes.h +1 -1
Index: linux-2.6.21-rc3/include/linux/kprobes.h
===================================================================
@@ -78,7 +78,7 @@ struct kprobe {
 	kprobe_opcode_t *addr;
 
 	/* Allow user to indicate symbol name of the probe point */
-	char *symbol_name;
+	const char *symbol_name;
 
 	/* Offset into the symbol */
 	unsigned int offset;
#1 lore raw
Quoted 9 lines · Ananth N Mavinakayanahalli

From: Ananth N Mavinakayanahalli <[email protected]>

Kprobes doesn't scribble the kprobe.symbol_name field. Its only set by the module when registering the probe. Modules that exercise good hygiene using the "const" qualifier will see warnings...

warning: assignment discards qualifiers from pointer target type

Make struct kprobe.symbol_name const char *

Ok.