Skip to content

Commit

Permalink
tracepoint: Fix sparse warnings in tracepoint.c
Browse files Browse the repository at this point in the history
Fix the following sparse warnings:

  CHECK   kernel/tracepoint.c
kernel/tracepoint.c:184:18: warning: incorrect type in assignment (different address spaces)
kernel/tracepoint.c:184:18:    expected struct tracepoint_func *tp_funcs
kernel/tracepoint.c:184:18:    got struct tracepoint_func [noderef] <asn:4>*funcs
kernel/tracepoint.c:216:18: warning: incorrect type in assignment (different address spaces)
kernel/tracepoint.c:216:18:    expected struct tracepoint_func *tp_funcs
kernel/tracepoint.c:216:18:    got struct tracepoint_func [noderef] <asn:4>*funcs
kernel/tracepoint.c:392:24: error: return expression in void function
  CC      kernel/tracepoint.o
kernel/tracepoint.c: In function tracepoint_module_going:
kernel/tracepoint.c:491:6: warning: symbol 'syscall_regfunc' was not declared. Should it be static?
kernel/tracepoint.c:508:6: warning: symbol 'syscall_unregfunc' was not declared. Should it be static?

Link: http://lkml.kernel.org/r/1397049883-28692-1-git-send-email-mathieu.desnoyers@efficios.com

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Mathieu Desnoyers authored and Steven Rostedt committed Apr 9, 2014
1 parent eb7d035 commit b725dfe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions include/linux/tracepoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ static inline void tracepoint_synchronize_unregister(void)
synchronize_sched();
}

#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
extern void syscall_regfunc(void);
extern void syscall_unregfunc(void);
#endif /* CONFIG_HAVE_SYSCALL_TRACEPOINTS */

#define PARAMS(args...) args

#endif /* _LINUX_TRACEPOINT_H */
Expand Down
3 changes: 0 additions & 3 deletions include/trace/events/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@

#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS

extern void syscall_regfunc(void);
extern void syscall_unregfunc(void);

TRACE_EVENT_FN(sys_enter,

TP_PROTO(struct pt_regs *regs, long id),
Expand Down
6 changes: 4 additions & 2 deletions kernel/tracepoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ static int tracepoint_add_func(struct tracepoint *tp,
if (tp->regfunc && !static_key_enabled(&tp->key))
tp->regfunc();

tp_funcs = tp->funcs;
tp_funcs = rcu_dereference_protected(tp->funcs,
lockdep_is_held(&tracepoints_mutex));
old = func_add(&tp_funcs, func);
if (IS_ERR(old)) {
WARN_ON_ONCE(1);
Expand Down Expand Up @@ -213,7 +214,8 @@ static int tracepoint_remove_func(struct tracepoint *tp,
{
struct tracepoint_func *old, *tp_funcs;

tp_funcs = tp->funcs;
tp_funcs = rcu_dereference_protected(tp->funcs,
lockdep_is_held(&tracepoints_mutex));
old = func_remove(&tp_funcs, func);
if (IS_ERR(old)) {
WARN_ON_ONCE(1);
Expand Down

0 comments on commit b725dfe

Please sign in to comment.