All of lore.kernel.org
 help / color / mirror / Atom feed
* warning: ‘x86_get_event_constraints’ defined but not used
@ 2011-08-15 23:40 Kevin Winchester
  2011-08-23 13:23 ` Peter Zijlstra
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Winchester @ 2011-08-15 23:40 UTC (permalink / raw)
  To: acme, mingo, a.p.zijlstra; +Cc: x86, linux-kernel

Hi,

From:

    gcc (GCC) 4.6.1

I get the following warning:

    arch/x86/kernel/cpu/perf_event.c:1444:1: warning:
‘x86_get_event_constraints’ defined but not used [-Wunused-function]

It appears that function is only called in some of the C files that
are included into perf_event.c, namely perf_event_intel.c,
perf_event_p4.c and perf_event_p6.c.  Each of those files is
completely dependent on CONFIG_CPU_SUP_INTEL, which I obviously do not
have enabled.

At the moment, I have eliminated the warning with the patch below, but
I do not consider that to be optimal.  Is there are reason why those C
files are included directly in another C file rather than being linked
together?  Or is there some other way the code could be improved and
also remove the warning at the same time?

I do not mind doing some coding here to make this happen.  I am very
close to a warning-free build, so I would definitely like to take care
of this one.

diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 4ee3abf..a37e7e9 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -1440,6 +1440,7 @@ static __read_mostly struct notifier_block
perf_event_nmi_notifier = {
 static struct event_constraint unconstrained;
 static struct event_constraint emptyconstraint;

+#ifdef CONFIG_CPU_SUP_INTEL
 static struct event_constraint *
 x86_get_event_constraints(struct cpu_hw_events *cpuc, struct perf_event *event)
 {
@@ -1454,6 +1455,7 @@ x86_get_event_constraints(struct cpu_hw_events
*cpuc, struct perf_event *event)

        return &unconstrained;
 }
+#endif

 #include "perf_event_amd.c"
 #include "perf_event_p6.c"


Thanks,

-- 
Kevin Winchester

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-09-19 10:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-15 23:40 warning: ‘x86_get_event_constraints’ defined but not used Kevin Winchester
2011-08-23 13:23 ` Peter Zijlstra
2011-08-23 13:31   ` Kevin Winchester
2011-08-30 11:21   ` [RFC PATCH] x86: perf: Clean up perf_event cpu code Kevin Winchester
2011-08-30 11:35     ` Peter Zijlstra
2011-08-30 23:41       ` [PATCH] " Kevin Winchester
2011-09-02 13:32         ` Peter Zijlstra
2011-09-19 10:27         ` Peter Zijlstra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.