Commit 7a45fb19 authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Paul Mackerras

[PATCH] powerpc: oprofile cpu type names clash with other code

In 2.6.15-git6 a change was commited in the oprofile support in
the powerpc architecture.  It introduced the powerpc_oprofile_type
which contains the define G4.  This causes a name clash with the
existing wacom usb tablet driver.

      CC [M]  drivers/usb/input/wacom.o
    drivers/usb/input/wacom.c:98: error: conflicting types for `G4'
    include/asm/cputable.h:37: error: previous declaration of `G4'
      CC [M]  drivers/usb/mon/mon_text.o
    make[3]: *** [drivers/usb/input/wacom.o] Error 1
    make[2]: *** [drivers/usb/input] Error 2

The elements of an enum declared in global scope are effectivly
global identifiers themselves.  As such we need to ensure the names
are unique.  This patch updates the later oprofile support to use
unique names.
Signed-off-by: default avatarAndy Whitcroft <apw@shadowen.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 80f15dc7
...@@ -80,7 +80,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -80,7 +80,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power3, .cpu_setup = __setup_cpu_power3,
.oprofile_cpu_type = "ppc64/power3", .oprofile_cpu_type = "ppc64/power3",
.oprofile_type = RS64, .oprofile_type = PPC_OPROFILE_RS64,
.platform = "power3", .platform = "power3",
}, },
{ /* Power3+ */ { /* Power3+ */
...@@ -94,7 +94,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -94,7 +94,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power3, .cpu_setup = __setup_cpu_power3,
.oprofile_cpu_type = "ppc64/power3", .oprofile_cpu_type = "ppc64/power3",
.oprofile_type = RS64, .oprofile_type = PPC_OPROFILE_RS64,
.platform = "power3", .platform = "power3",
}, },
{ /* Northstar */ { /* Northstar */
...@@ -108,7 +108,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -108,7 +108,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power3, .cpu_setup = __setup_cpu_power3,
.oprofile_cpu_type = "ppc64/rs64", .oprofile_cpu_type = "ppc64/rs64",
.oprofile_type = RS64, .oprofile_type = PPC_OPROFILE_RS64,
.platform = "rs64", .platform = "rs64",
}, },
{ /* Pulsar */ { /* Pulsar */
...@@ -122,7 +122,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -122,7 +122,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power3, .cpu_setup = __setup_cpu_power3,
.oprofile_cpu_type = "ppc64/rs64", .oprofile_cpu_type = "ppc64/rs64",
.oprofile_type = RS64, .oprofile_type = PPC_OPROFILE_RS64,
.platform = "rs64", .platform = "rs64",
}, },
{ /* I-star */ { /* I-star */
...@@ -136,7 +136,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -136,7 +136,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power3, .cpu_setup = __setup_cpu_power3,
.oprofile_cpu_type = "ppc64/rs64", .oprofile_cpu_type = "ppc64/rs64",
.oprofile_type = RS64, .oprofile_type = PPC_OPROFILE_RS64,
.platform = "rs64", .platform = "rs64",
}, },
{ /* S-star */ { /* S-star */
...@@ -150,7 +150,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -150,7 +150,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power3, .cpu_setup = __setup_cpu_power3,
.oprofile_cpu_type = "ppc64/rs64", .oprofile_cpu_type = "ppc64/rs64",
.oprofile_type = RS64, .oprofile_type = PPC_OPROFILE_RS64,
.platform = "rs64", .platform = "rs64",
}, },
{ /* Power4 */ { /* Power4 */
...@@ -164,7 +164,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -164,7 +164,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power4, .cpu_setup = __setup_cpu_power4,
.oprofile_cpu_type = "ppc64/power4", .oprofile_cpu_type = "ppc64/power4",
.oprofile_type = POWER4, .oprofile_type = PPC_OPROFILE_POWER4,
.platform = "power4", .platform = "power4",
}, },
{ /* Power4+ */ { /* Power4+ */
...@@ -178,7 +178,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -178,7 +178,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power4, .cpu_setup = __setup_cpu_power4,
.oprofile_cpu_type = "ppc64/power4", .oprofile_cpu_type = "ppc64/power4",
.oprofile_type = POWER4, .oprofile_type = PPC_OPROFILE_POWER4,
.platform = "power4", .platform = "power4",
}, },
{ /* PPC970 */ { /* PPC970 */
...@@ -193,7 +193,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -193,7 +193,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_ppc970, .cpu_setup = __setup_cpu_ppc970,
.oprofile_cpu_type = "ppc64/970", .oprofile_cpu_type = "ppc64/970",
.oprofile_type = POWER4, .oprofile_type = PPC_OPROFILE_POWER4,
.platform = "ppc970", .platform = "ppc970",
}, },
#endif /* CONFIG_PPC64 */ #endif /* CONFIG_PPC64 */
...@@ -214,7 +214,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -214,7 +214,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_ppc970, .cpu_setup = __setup_cpu_ppc970,
.oprofile_cpu_type = "ppc64/970", .oprofile_cpu_type = "ppc64/970",
.oprofile_type = POWER4, .oprofile_type = PPC_OPROFILE_POWER4,
.platform = "ppc970", .platform = "ppc970",
}, },
#endif /* defined(CONFIG_PPC64) || defined(CONFIG_POWER4) */ #endif /* defined(CONFIG_PPC64) || defined(CONFIG_POWER4) */
...@@ -230,7 +230,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -230,7 +230,7 @@ struct cpu_spec cpu_specs[] = {
.dcache_bsize = 128, .dcache_bsize = 128,
.cpu_setup = __setup_cpu_ppc970, .cpu_setup = __setup_cpu_ppc970,
.oprofile_cpu_type = "ppc64/970", .oprofile_cpu_type = "ppc64/970",
.oprofile_type = POWER4, .oprofile_type = PPC_OPROFILE_POWER4,
.platform = "ppc970", .platform = "ppc970",
}, },
{ /* Power5 GR */ { /* Power5 GR */
...@@ -244,7 +244,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -244,7 +244,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 6, .num_pmcs = 6,
.cpu_setup = __setup_cpu_power4, .cpu_setup = __setup_cpu_power4,
.oprofile_cpu_type = "ppc64/power5", .oprofile_cpu_type = "ppc64/power5",
.oprofile_type = POWER4, .oprofile_type = PPC_OPROFILE_POWER4,
.platform = "power5", .platform = "power5",
}, },
{ /* Power5 GS */ { /* Power5 GS */
...@@ -258,7 +258,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -258,7 +258,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 6, .num_pmcs = 6,
.cpu_setup = __setup_cpu_power4, .cpu_setup = __setup_cpu_power4,
.oprofile_cpu_type = "ppc64/power5+", .oprofile_cpu_type = "ppc64/power5+",
.oprofile_type = POWER4, .oprofile_type = PPC_OPROFILE_POWER4,
.platform = "power5+", .platform = "power5+",
}, },
{ /* Cell Broadband Engine */ { /* Cell Broadband Engine */
...@@ -559,7 +559,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -559,7 +559,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 6, .num_pmcs = 6,
.cpu_setup = __setup_cpu_745x, .cpu_setup = __setup_cpu_745x,
.oprofile_cpu_type = "ppc/7450", .oprofile_cpu_type = "ppc/7450",
.oprofile_type = G4, .oprofile_type = PPC_OPROFILE_G4,
.platform = "ppc7450", .platform = "ppc7450",
}, },
{ /* 7450 2.1 */ { /* 7450 2.1 */
...@@ -573,7 +573,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -573,7 +573,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 6, .num_pmcs = 6,
.cpu_setup = __setup_cpu_745x, .cpu_setup = __setup_cpu_745x,
.oprofile_cpu_type = "ppc/7450", .oprofile_cpu_type = "ppc/7450",
.oprofile_type = G4, .oprofile_type = PPC_OPROFILE_G4,
.platform = "ppc7450", .platform = "ppc7450",
}, },
{ /* 7450 2.3 and newer */ { /* 7450 2.3 and newer */
...@@ -587,7 +587,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -587,7 +587,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 6, .num_pmcs = 6,
.cpu_setup = __setup_cpu_745x, .cpu_setup = __setup_cpu_745x,
.oprofile_cpu_type = "ppc/7450", .oprofile_cpu_type = "ppc/7450",
.oprofile_type = G4, .oprofile_type = PPC_OPROFILE_G4,
.platform = "ppc7450", .platform = "ppc7450",
}, },
{ /* 7455 rev 1.x */ { /* 7455 rev 1.x */
...@@ -601,7 +601,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -601,7 +601,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 6, .num_pmcs = 6,
.cpu_setup = __setup_cpu_745x, .cpu_setup = __setup_cpu_745x,
.oprofile_cpu_type = "ppc/7450", .oprofile_cpu_type = "ppc/7450",
.oprofile_type = G4, .oprofile_type = PPC_OPROFILE_G4,
.platform = "ppc7450", .platform = "ppc7450",
}, },
{ /* 7455 rev 2.0 */ { /* 7455 rev 2.0 */
...@@ -615,7 +615,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -615,7 +615,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 6, .num_pmcs = 6,
.cpu_setup = __setup_cpu_745x, .cpu_setup = __setup_cpu_745x,
.oprofile_cpu_type = "ppc/7450", .oprofile_cpu_type = "ppc/7450",
.oprofile_type = G4, .oprofile_type = PPC_OPROFILE_G4,
.platform = "ppc7450", .platform = "ppc7450",
}, },
{ /* 7455 others */ { /* 7455 others */
...@@ -629,7 +629,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -629,7 +629,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 6, .num_pmcs = 6,
.cpu_setup = __setup_cpu_745x, .cpu_setup = __setup_cpu_745x,
.oprofile_cpu_type = "ppc/7450", .oprofile_cpu_type = "ppc/7450",
.oprofile_type = G4, .oprofile_type = PPC_OPROFILE_G4,
.platform = "ppc7450", .platform = "ppc7450",
}, },
{ /* 7447/7457 Rev 1.0 */ { /* 7447/7457 Rev 1.0 */
...@@ -643,7 +643,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -643,7 +643,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 6, .num_pmcs = 6,
.cpu_setup = __setup_cpu_745x, .cpu_setup = __setup_cpu_745x,
.oprofile_cpu_type = "ppc/7450", .oprofile_cpu_type = "ppc/7450",
.oprofile_type = G4, .oprofile_type = PPC_OPROFILE_G4,
.platform = "ppc7450", .platform = "ppc7450",
}, },
{ /* 7447/7457 Rev 1.1 */ { /* 7447/7457 Rev 1.1 */
...@@ -657,7 +657,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -657,7 +657,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 6, .num_pmcs = 6,
.cpu_setup = __setup_cpu_745x, .cpu_setup = __setup_cpu_745x,
.oprofile_cpu_type = "ppc/7450", .oprofile_cpu_type = "ppc/7450",
.oprofile_type = G4, .oprofile_type = PPC_OPROFILE_G4,
.platform = "ppc7450", .platform = "ppc7450",
}, },
{ /* 7447/7457 Rev 1.2 and later */ { /* 7447/7457 Rev 1.2 and later */
...@@ -671,7 +671,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -671,7 +671,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 6, .num_pmcs = 6,
.cpu_setup = __setup_cpu_745x, .cpu_setup = __setup_cpu_745x,
.oprofile_cpu_type = "ppc/7450", .oprofile_cpu_type = "ppc/7450",
.oprofile_type = G4, .oprofile_type = PPC_OPROFILE_G4,
.platform = "ppc7450", .platform = "ppc7450",
}, },
{ /* 7447A */ { /* 7447A */
...@@ -685,7 +685,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -685,7 +685,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 6, .num_pmcs = 6,
.cpu_setup = __setup_cpu_745x, .cpu_setup = __setup_cpu_745x,
.oprofile_cpu_type = "ppc/7450", .oprofile_cpu_type = "ppc/7450",
.oprofile_type = G4, .oprofile_type = PPC_OPROFILE_G4,
.platform = "ppc7450", .platform = "ppc7450",
}, },
{ /* 7448 */ { /* 7448 */
...@@ -699,7 +699,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -699,7 +699,7 @@ struct cpu_spec cpu_specs[] = {
.num_pmcs = 6, .num_pmcs = 6,
.cpu_setup = __setup_cpu_745x, .cpu_setup = __setup_cpu_745x,
.oprofile_cpu_type = "ppc/7450", .oprofile_cpu_type = "ppc/7450",
.oprofile_type = G4, .oprofile_type = PPC_OPROFILE_G4,
.platform = "ppc7450", .platform = "ppc7450",
}, },
{ /* 82xx (8240, 8245, 8260 are all 603e cores) */ { /* 82xx (8240, 8245, 8260 are all 603e cores) */
...@@ -1056,7 +1056,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -1056,7 +1056,7 @@ struct cpu_spec cpu_specs[] = {
.dcache_bsize = 32, .dcache_bsize = 32,
.num_pmcs = 4, .num_pmcs = 4,
.oprofile_cpu_type = "ppc/e500", .oprofile_cpu_type = "ppc/e500",
.oprofile_type = BOOKE, .oprofile_type = PPC_OPROFILE_BOOKE,
.platform = "ppc8540", .platform = "ppc8540",
}, },
{ /* e500v2 */ { /* e500v2 */
...@@ -1073,7 +1073,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -1073,7 +1073,7 @@ struct cpu_spec cpu_specs[] = {
.dcache_bsize = 32, .dcache_bsize = 32,
.num_pmcs = 4, .num_pmcs = 4,
.oprofile_cpu_type = "ppc/e500", .oprofile_cpu_type = "ppc/e500",
.oprofile_type = BOOKE, .oprofile_type = PPC_OPROFILE_BOOKE,
.platform = "ppc8548", .platform = "ppc8548",
}, },
#endif #endif
......
...@@ -140,19 +140,19 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) ...@@ -140,19 +140,19 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
switch (cur_cpu_spec->oprofile_type) { switch (cur_cpu_spec->oprofile_type) {
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
case RS64: case PPC_OPROFILE_RS64:
model = &op_model_rs64; model = &op_model_rs64;
break; break;
case POWER4: case PPC_OPROFILE_POWER4:
model = &op_model_power4; model = &op_model_power4;
break; break;
#else #else
case G4: case PPC_OPROFILE_G4:
model = &op_model_7450; model = &op_model_7450;
break; break;
#endif #endif
#ifdef CONFIG_FSL_BOOKE #ifdef CONFIG_FSL_BOOKE
case BOOKE: case PPC_OPROFILE_BOOKE:
model = &op_model_fsl_booke; model = &op_model_fsl_booke;
break; break;
#endif #endif
......
...@@ -32,11 +32,11 @@ struct cpu_spec; ...@@ -32,11 +32,11 @@ struct cpu_spec;
typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec); typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec);
enum powerpc_oprofile_type { enum powerpc_oprofile_type {
INVALID = 0, PPC_OPROFILE_INVALID = 0,
RS64 = 1, PPC_OPROFILE_RS64 = 1,
POWER4 = 2, PPC_OPROFILE_POWER4 = 2,
G4 = 3, PPC_OPROFILE_G4 = 3,
BOOKE = 4, PPC_OPROFILE_BOOKE = 4,
}; };
struct cpu_spec { struct cpu_spec {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment