aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2010-11-30 12:15:53 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-12-04 06:17:44 -0500
commit4d6b7a779be34e1df296abc1dc555134a8cf34af (patch)
tree928b2459936859a87aaa2af46d521059cffca570 /arch/arm/kernel
parent83cf1eecfe9afee99d6b86f963187acd414c019d (diff)
ARM: 6512/1: perf: fix warnings generated by sparse
Russell reported a number of warnings coming from sparse when checking the ARM perf_event.c files: | perf_event.c seems to also have problems too: | | CHECK arch/arm/kernel/perf_event.c | arch/arm/kernel/perf_event.c:37:1: warning: symbol 'pmu_lock' was not declared. Should it be static? | arch/arm/kernel/perf_event.c:70:1: warning: symbol 'cpu_hw_events' was not declared. Should it be static? | arch/arm/kernel/perf_event.c:1006:1: warning: symbol 'armv6pmu_enable_event' was not declared. Should it be static? | arch/arm/kernel/perf_event.c:1113:1: warning: symbol 'armv6pmu_stop' was not declared. Should it be static? | arch/arm/kernel/perf_event.c:1956:6: warning: symbol 'armv7pmu_enable_event' was not declared. Should it be static? | arch/arm/kernel/perf_event.c:3072:14: warning: incorrect type in argument 1 (different address spaces) | arch/arm/kernel/perf_event.c:3072:14: expected void const volatile [noderef] <asn:1>*<noident> | arch/arm/kernel/perf_event.c:3072:14: got struct frame_tail *tail | arch/arm/kernel/perf_event.c:3074:49: warning: incorrect type in argument 2 (different address spaces) | arch/arm/kernel/perf_event.c:3074:49: expected void const [noderef] <asn:1>*from | arch/arm/kernel/perf_event.c:3074:49: got struct frame_tail *tail This patch resolves these issues so we can live in silence again. Reported-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/perf_event.c18
-rw-r--r--arch/arm/kernel/perf_event_v6.c10
-rw-r--r--arch/arm/kernel/perf_event_v7.c10
-rw-r--r--arch/arm/kernel/perf_event_xscale.c8
4 files changed, 23 insertions, 23 deletions
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 421a4bb88fed..50c197bfac0f 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -32,7 +32,7 @@ static struct platform_device *pmu_device;
32 * Hardware lock to serialize accesses to PMU registers. Needed for the 32 * Hardware lock to serialize accesses to PMU registers. Needed for the
33 * read/modify/write sequences. 33 * read/modify/write sequences.
34 */ 34 */
35DEFINE_SPINLOCK(pmu_lock); 35static DEFINE_SPINLOCK(pmu_lock);
36 36
37/* 37/*
38 * ARMv6 supports a maximum of 3 events, starting from index 1. If we add 38 * ARMv6 supports a maximum of 3 events, starting from index 1. If we add
@@ -65,7 +65,7 @@ struct cpu_hw_events {
65 */ 65 */
66 unsigned long active_mask[BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)]; 66 unsigned long active_mask[BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)];
67}; 67};
68DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events); 68static DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events);
69 69
70struct arm_pmu { 70struct arm_pmu {
71 enum arm_perf_pmu_ids id; 71 enum arm_perf_pmu_ids id;
@@ -673,17 +673,17 @@ arch_initcall(init_hw_perf_events);
673 * This code has been adapted from the ARM OProfile support. 673 * This code has been adapted from the ARM OProfile support.
674 */ 674 */
675struct frame_tail { 675struct frame_tail {
676 struct frame_tail *fp; 676 struct frame_tail __user *fp;
677 unsigned long sp; 677 unsigned long sp;
678 unsigned long lr; 678 unsigned long lr;
679} __attribute__((packed)); 679} __attribute__((packed));
680 680
681/* 681/*
682 * Get the return address for a single stackframe and return a pointer to the 682 * Get the return address for a single stackframe and return a pointer to the
683 * next frame tail. 683 * next frame tail.
684 */ 684 */
685static struct frame_tail * 685static struct frame_tail __user *
686user_backtrace(struct frame_tail *tail, 686user_backtrace(struct frame_tail __user *tail,
687 struct perf_callchain_entry *entry) 687 struct perf_callchain_entry *entry)
688{ 688{
689 struct frame_tail buftail; 689 struct frame_tail buftail;
@@ -709,10 +709,10 @@ user_backtrace(struct frame_tail *tail,
709void 709void
710perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) 710perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
711{ 711{
712 struct frame_tail *tail; 712 struct frame_tail __user *tail;
713 713
714 714
715 tail = (struct frame_tail *)regs->ARM_fp - 1; 715 tail = (struct frame_tail __user *)regs->ARM_fp - 1;
716 716
717 while (tail && !((unsigned long)tail & 0x3)) 717 while (tail && !((unsigned long)tail & 0x3))
718 tail = user_backtrace(tail, entry); 718 tail = user_backtrace(tail, entry);
diff --git a/arch/arm/kernel/perf_event_v6.c b/arch/arm/kernel/perf_event_v6.c
index 7aeb07da9076..3f427aae211d 100644
--- a/arch/arm/kernel/perf_event_v6.c
+++ b/arch/arm/kernel/perf_event_v6.c
@@ -400,7 +400,7 @@ armv6pmu_write_counter(int counter,
400 WARN_ONCE(1, "invalid counter number (%d)\n", counter); 400 WARN_ONCE(1, "invalid counter number (%d)\n", counter);
401} 401}
402 402
403void 403static void
404armv6pmu_enable_event(struct hw_perf_event *hwc, 404armv6pmu_enable_event(struct hw_perf_event *hwc,
405 int idx) 405 int idx)
406{ 406{
@@ -625,7 +625,7 @@ static const struct arm_pmu armv6pmu = {
625 .max_period = (1LLU << 32) - 1, 625 .max_period = (1LLU << 32) - 1,
626}; 626};
627 627
628const struct arm_pmu *__init armv6pmu_init(void) 628static const struct arm_pmu *__init armv6pmu_init(void)
629{ 629{
630 return &armv6pmu; 630 return &armv6pmu;
631} 631}
@@ -655,17 +655,17 @@ static const struct arm_pmu armv6mpcore_pmu = {
655 .max_period = (1LLU << 32) - 1, 655 .max_period = (1LLU << 32) - 1,
656}; 656};
657 657
658const struct arm_pmu *__init armv6mpcore_pmu_init(void) 658static const struct arm_pmu *__init armv6mpcore_pmu_init(void)
659{ 659{
660 return &armv6mpcore_pmu; 660 return &armv6mpcore_pmu;
661} 661}
662#else 662#else
663const struct arm_pmu *__init armv6pmu_init(void) 663static const struct arm_pmu *__init armv6pmu_init(void)
664{ 664{
665 return NULL; 665 return NULL;
666} 666}
667 667
668const struct arm_pmu *__init armv6mpcore_pmu_init(void) 668static const struct arm_pmu *__init armv6mpcore_pmu_init(void)
669{ 669{
670 return NULL; 670 return NULL;
671} 671}
diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c
index 4d0423969df9..a68ff1c10dec 100644
--- a/arch/arm/kernel/perf_event_v7.c
+++ b/arch/arm/kernel/perf_event_v7.c
@@ -681,7 +681,7 @@ static void armv7_pmnc_dump_regs(void)
681} 681}
682#endif 682#endif
683 683
684void armv7pmu_enable_event(struct hw_perf_event *hwc, int idx) 684static void armv7pmu_enable_event(struct hw_perf_event *hwc, int idx)
685{ 685{
686 unsigned long flags; 686 unsigned long flags;
687 687
@@ -874,7 +874,7 @@ static u32 __init armv7_reset_read_pmnc(void)
874 return nb_cnt + 1; 874 return nb_cnt + 1;
875} 875}
876 876
877const struct arm_pmu *__init armv7_a8_pmu_init(void) 877static const struct arm_pmu *__init armv7_a8_pmu_init(void)
878{ 878{
879 armv7pmu.id = ARM_PERF_PMU_ID_CA8; 879 armv7pmu.id = ARM_PERF_PMU_ID_CA8;
880 armv7pmu.name = "ARMv7 Cortex-A8"; 880 armv7pmu.name = "ARMv7 Cortex-A8";
@@ -884,7 +884,7 @@ const struct arm_pmu *__init armv7_a8_pmu_init(void)
884 return &armv7pmu; 884 return &armv7pmu;
885} 885}
886 886
887const struct arm_pmu *__init armv7_a9_pmu_init(void) 887static const struct arm_pmu *__init armv7_a9_pmu_init(void)
888{ 888{
889 armv7pmu.id = ARM_PERF_PMU_ID_CA9; 889 armv7pmu.id = ARM_PERF_PMU_ID_CA9;
890 armv7pmu.name = "ARMv7 Cortex-A9"; 890 armv7pmu.name = "ARMv7 Cortex-A9";
@@ -894,12 +894,12 @@ const struct arm_pmu *__init armv7_a9_pmu_init(void)
894 return &armv7pmu; 894 return &armv7pmu;
895} 895}
896#else 896#else
897const struct arm_pmu *__init armv7_a8_pmu_init(void) 897static const struct arm_pmu *__init armv7_a8_pmu_init(void)
898{ 898{
899 return NULL; 899 return NULL;
900} 900}
901 901
902const struct arm_pmu *__init armv7_a9_pmu_init(void) 902static const struct arm_pmu *__init armv7_a9_pmu_init(void)
903{ 903{
904 return NULL; 904 return NULL;
905} 905}
diff --git a/arch/arm/kernel/perf_event_xscale.c b/arch/arm/kernel/perf_event_xscale.c
index 4e9592789d40..f14fbb6c345b 100644
--- a/arch/arm/kernel/perf_event_xscale.c
+++ b/arch/arm/kernel/perf_event_xscale.c
@@ -428,7 +428,7 @@ static const struct arm_pmu xscale1pmu = {
428 .max_period = (1LLU << 32) - 1, 428 .max_period = (1LLU << 32) - 1,
429}; 429};
430 430
431const struct arm_pmu *__init xscale1pmu_init(void) 431static const struct arm_pmu *__init xscale1pmu_init(void)
432{ 432{
433 return &xscale1pmu; 433 return &xscale1pmu;
434} 434}
@@ -790,17 +790,17 @@ static const struct arm_pmu xscale2pmu = {
790 .max_period = (1LLU << 32) - 1, 790 .max_period = (1LLU << 32) - 1,
791}; 791};
792 792
793const struct arm_pmu *__init xscale2pmu_init(void) 793static const struct arm_pmu *__init xscale2pmu_init(void)
794{ 794{
795 return &xscale2pmu; 795 return &xscale2pmu;
796} 796}
797#else 797#else
798const struct arm_pmu *__init xscale1pmu_init(void) 798static const struct arm_pmu *__init xscale1pmu_init(void)
799{ 799{
800 return NULL; 800 return NULL;
801} 801}
802 802
803const struct arm_pmu *__init xscale2pmu_init(void) 803static const struct arm_pmu *__init xscale2pmu_init(void)
804{ 804{
805 return NULL; 805 return NULL;
806} 806}