Commit 7a45fb19cef93574230827e6e2c97ad5760ddecd

Authored by Andy Whitcroft
Committed by Paul Mackerras
1 parent 80f15dc703

[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: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Showing 3 changed files with 35 additions and 35 deletions Side-by-side Diff

arch/powerpc/kernel/cputable.c
... ... @@ -80,7 +80,7 @@
80 80 .num_pmcs = 8,
81 81 .cpu_setup = __setup_cpu_power3,
82 82 .oprofile_cpu_type = "ppc64/power3",
83   - .oprofile_type = RS64,
  83 + .oprofile_type = PPC_OPROFILE_RS64,
84 84 .platform = "power3",
85 85 },
86 86 { /* Power3+ */
... ... @@ -94,7 +94,7 @@
94 94 .num_pmcs = 8,
95 95 .cpu_setup = __setup_cpu_power3,
96 96 .oprofile_cpu_type = "ppc64/power3",
97   - .oprofile_type = RS64,
  97 + .oprofile_type = PPC_OPROFILE_RS64,
98 98 .platform = "power3",
99 99 },
100 100 { /* Northstar */
... ... @@ -108,7 +108,7 @@
108 108 .num_pmcs = 8,
109 109 .cpu_setup = __setup_cpu_power3,
110 110 .oprofile_cpu_type = "ppc64/rs64",
111   - .oprofile_type = RS64,
  111 + .oprofile_type = PPC_OPROFILE_RS64,
112 112 .platform = "rs64",
113 113 },
114 114 { /* Pulsar */
... ... @@ -122,7 +122,7 @@
122 122 .num_pmcs = 8,
123 123 .cpu_setup = __setup_cpu_power3,
124 124 .oprofile_cpu_type = "ppc64/rs64",
125   - .oprofile_type = RS64,
  125 + .oprofile_type = PPC_OPROFILE_RS64,
126 126 .platform = "rs64",
127 127 },
128 128 { /* I-star */
... ... @@ -136,7 +136,7 @@
136 136 .num_pmcs = 8,
137 137 .cpu_setup = __setup_cpu_power3,
138 138 .oprofile_cpu_type = "ppc64/rs64",
139   - .oprofile_type = RS64,
  139 + .oprofile_type = PPC_OPROFILE_RS64,
140 140 .platform = "rs64",
141 141 },
142 142 { /* S-star */
... ... @@ -150,7 +150,7 @@
150 150 .num_pmcs = 8,
151 151 .cpu_setup = __setup_cpu_power3,
152 152 .oprofile_cpu_type = "ppc64/rs64",
153   - .oprofile_type = RS64,
  153 + .oprofile_type = PPC_OPROFILE_RS64,
154 154 .platform = "rs64",
155 155 },
156 156 { /* Power4 */
... ... @@ -164,7 +164,7 @@
164 164 .num_pmcs = 8,
165 165 .cpu_setup = __setup_cpu_power4,
166 166 .oprofile_cpu_type = "ppc64/power4",
167   - .oprofile_type = POWER4,
  167 + .oprofile_type = PPC_OPROFILE_POWER4,
168 168 .platform = "power4",
169 169 },
170 170 { /* Power4+ */
... ... @@ -178,7 +178,7 @@
178 178 .num_pmcs = 8,
179 179 .cpu_setup = __setup_cpu_power4,
180 180 .oprofile_cpu_type = "ppc64/power4",
181   - .oprofile_type = POWER4,
  181 + .oprofile_type = PPC_OPROFILE_POWER4,
182 182 .platform = "power4",
183 183 },
184 184 { /* PPC970 */
... ... @@ -193,7 +193,7 @@
193 193 .num_pmcs = 8,
194 194 .cpu_setup = __setup_cpu_ppc970,
195 195 .oprofile_cpu_type = "ppc64/970",
196   - .oprofile_type = POWER4,
  196 + .oprofile_type = PPC_OPROFILE_POWER4,
197 197 .platform = "ppc970",
198 198 },
199 199 #endif /* CONFIG_PPC64 */
... ... @@ -214,7 +214,7 @@
214 214 .num_pmcs = 8,
215 215 .cpu_setup = __setup_cpu_ppc970,
216 216 .oprofile_cpu_type = "ppc64/970",
217   - .oprofile_type = POWER4,
  217 + .oprofile_type = PPC_OPROFILE_POWER4,
218 218 .platform = "ppc970",
219 219 },
220 220 #endif /* defined(CONFIG_PPC64) || defined(CONFIG_POWER4) */
... ... @@ -230,7 +230,7 @@
230 230 .dcache_bsize = 128,
231 231 .cpu_setup = __setup_cpu_ppc970,
232 232 .oprofile_cpu_type = "ppc64/970",
233   - .oprofile_type = POWER4,
  233 + .oprofile_type = PPC_OPROFILE_POWER4,
234 234 .platform = "ppc970",
235 235 },
236 236 { /* Power5 GR */
... ... @@ -244,7 +244,7 @@
244 244 .num_pmcs = 6,
245 245 .cpu_setup = __setup_cpu_power4,
246 246 .oprofile_cpu_type = "ppc64/power5",
247   - .oprofile_type = POWER4,
  247 + .oprofile_type = PPC_OPROFILE_POWER4,
248 248 .platform = "power5",
249 249 },
250 250 { /* Power5 GS */
... ... @@ -258,7 +258,7 @@
258 258 .num_pmcs = 6,
259 259 .cpu_setup = __setup_cpu_power4,
260 260 .oprofile_cpu_type = "ppc64/power5+",
261   - .oprofile_type = POWER4,
  261 + .oprofile_type = PPC_OPROFILE_POWER4,
262 262 .platform = "power5+",
263 263 },
264 264 { /* Cell Broadband Engine */
... ... @@ -559,7 +559,7 @@
559 559 .num_pmcs = 6,
560 560 .cpu_setup = __setup_cpu_745x,
561 561 .oprofile_cpu_type = "ppc/7450",
562   - .oprofile_type = G4,
  562 + .oprofile_type = PPC_OPROFILE_G4,
563 563 .platform = "ppc7450",
564 564 },
565 565 { /* 7450 2.1 */
... ... @@ -573,7 +573,7 @@
573 573 .num_pmcs = 6,
574 574 .cpu_setup = __setup_cpu_745x,
575 575 .oprofile_cpu_type = "ppc/7450",
576   - .oprofile_type = G4,
  576 + .oprofile_type = PPC_OPROFILE_G4,
577 577 .platform = "ppc7450",
578 578 },
579 579 { /* 7450 2.3 and newer */
... ... @@ -587,7 +587,7 @@
587 587 .num_pmcs = 6,
588 588 .cpu_setup = __setup_cpu_745x,
589 589 .oprofile_cpu_type = "ppc/7450",
590   - .oprofile_type = G4,
  590 + .oprofile_type = PPC_OPROFILE_G4,
591 591 .platform = "ppc7450",
592 592 },
593 593 { /* 7455 rev 1.x */
... ... @@ -601,7 +601,7 @@
601 601 .num_pmcs = 6,
602 602 .cpu_setup = __setup_cpu_745x,
603 603 .oprofile_cpu_type = "ppc/7450",
604   - .oprofile_type = G4,
  604 + .oprofile_type = PPC_OPROFILE_G4,
605 605 .platform = "ppc7450",
606 606 },
607 607 { /* 7455 rev 2.0 */
... ... @@ -615,7 +615,7 @@
615 615 .num_pmcs = 6,
616 616 .cpu_setup = __setup_cpu_745x,
617 617 .oprofile_cpu_type = "ppc/7450",
618   - .oprofile_type = G4,
  618 + .oprofile_type = PPC_OPROFILE_G4,
619 619 .platform = "ppc7450",
620 620 },
621 621 { /* 7455 others */
... ... @@ -629,7 +629,7 @@
629 629 .num_pmcs = 6,
630 630 .cpu_setup = __setup_cpu_745x,
631 631 .oprofile_cpu_type = "ppc/7450",
632   - .oprofile_type = G4,
  632 + .oprofile_type = PPC_OPROFILE_G4,
633 633 .platform = "ppc7450",
634 634 },
635 635 { /* 7447/7457 Rev 1.0 */
... ... @@ -643,7 +643,7 @@
643 643 .num_pmcs = 6,
644 644 .cpu_setup = __setup_cpu_745x,
645 645 .oprofile_cpu_type = "ppc/7450",
646   - .oprofile_type = G4,
  646 + .oprofile_type = PPC_OPROFILE_G4,
647 647 .platform = "ppc7450",
648 648 },
649 649 { /* 7447/7457 Rev 1.1 */
... ... @@ -657,7 +657,7 @@
657 657 .num_pmcs = 6,
658 658 .cpu_setup = __setup_cpu_745x,
659 659 .oprofile_cpu_type = "ppc/7450",
660   - .oprofile_type = G4,
  660 + .oprofile_type = PPC_OPROFILE_G4,
661 661 .platform = "ppc7450",
662 662 },
663 663 { /* 7447/7457 Rev 1.2 and later */
... ... @@ -671,7 +671,7 @@
671 671 .num_pmcs = 6,
672 672 .cpu_setup = __setup_cpu_745x,
673 673 .oprofile_cpu_type = "ppc/7450",
674   - .oprofile_type = G4,
  674 + .oprofile_type = PPC_OPROFILE_G4,
675 675 .platform = "ppc7450",
676 676 },
677 677 { /* 7447A */
... ... @@ -685,7 +685,7 @@
685 685 .num_pmcs = 6,
686 686 .cpu_setup = __setup_cpu_745x,
687 687 .oprofile_cpu_type = "ppc/7450",
688   - .oprofile_type = G4,
  688 + .oprofile_type = PPC_OPROFILE_G4,
689 689 .platform = "ppc7450",
690 690 },
691 691 { /* 7448 */
... ... @@ -699,7 +699,7 @@
699 699 .num_pmcs = 6,
700 700 .cpu_setup = __setup_cpu_745x,
701 701 .oprofile_cpu_type = "ppc/7450",
702   - .oprofile_type = G4,
  702 + .oprofile_type = PPC_OPROFILE_G4,
703 703 .platform = "ppc7450",
704 704 },
705 705 { /* 82xx (8240, 8245, 8260 are all 603e cores) */
... ... @@ -1056,7 +1056,7 @@
1056 1056 .dcache_bsize = 32,
1057 1057 .num_pmcs = 4,
1058 1058 .oprofile_cpu_type = "ppc/e500",
1059   - .oprofile_type = BOOKE,
  1059 + .oprofile_type = PPC_OPROFILE_BOOKE,
1060 1060 .platform = "ppc8540",
1061 1061 },
1062 1062 { /* e500v2 */
... ... @@ -1073,7 +1073,7 @@
1073 1073 .dcache_bsize = 32,
1074 1074 .num_pmcs = 4,
1075 1075 .oprofile_cpu_type = "ppc/e500",
1076   - .oprofile_type = BOOKE,
  1076 + .oprofile_type = PPC_OPROFILE_BOOKE,
1077 1077 .platform = "ppc8548",
1078 1078 },
1079 1079 #endif
arch/powerpc/oprofile/common.c
... ... @@ -140,19 +140,19 @@
140 140  
141 141 switch (cur_cpu_spec->oprofile_type) {
142 142 #ifdef CONFIG_PPC64
143   - case RS64:
  143 + case PPC_OPROFILE_RS64:
144 144 model = &op_model_rs64;
145 145 break;
146   - case POWER4:
  146 + case PPC_OPROFILE_POWER4:
147 147 model = &op_model_power4;
148 148 break;
149 149 #else
150   - case G4:
  150 + case PPC_OPROFILE_G4:
151 151 model = &op_model_7450;
152 152 break;
153 153 #endif
154 154 #ifdef CONFIG_FSL_BOOKE
155   - case BOOKE:
  155 + case PPC_OPROFILE_BOOKE:
156 156 model = &op_model_fsl_booke;
157 157 break;
158 158 #endif
include/asm-powerpc/cputable.h
... ... @@ -32,11 +32,11 @@
32 32 typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec);
33 33  
34 34 enum powerpc_oprofile_type {
35   - INVALID = 0,
36   - RS64 = 1,
37   - POWER4 = 2,
38   - G4 = 3,
39   - BOOKE = 4,
  35 + PPC_OPROFILE_INVALID = 0,
  36 + PPC_OPROFILE_RS64 = 1,
  37 + PPC_OPROFILE_POWER4 = 2,
  38 + PPC_OPROFILE_G4 = 3,
  39 + PPC_OPROFILE_BOOKE = 4,
40 40 };
41 41  
42 42 struct cpu_spec {