lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 15 Aug 2011 20:40:13 -0300
From:	Kevin Winchester <kjwinchester@...il.com>
To:	acme@...stprotocols.net, mingo@...e.hu, a.p.zijlstra@...llo.nl
Cc:	x86@...nel.org, linux-kernel@...r.kernel.org
Subject: warning: ‘x86_get_event_constraints’ defined but not used

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ