diff options
author | Will Deacon <will.deacon@arm.com> | 2010-11-30 12:15:53 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-12-04 06:17:44 -0500 |
commit | 4d6b7a779be34e1df296abc1dc555134a8cf34af (patch) | |
tree | 928b2459936859a87aaa2af46d521059cffca570 /arch/arm/kernel | |
parent | 83cf1eecfe9afee99d6b86f963187acd414c019d (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.c | 18 | ||||
-rw-r--r-- | arch/arm/kernel/perf_event_v6.c | 10 | ||||
-rw-r--r-- | arch/arm/kernel/perf_event_v7.c | 10 | ||||
-rw-r--r-- | arch/arm/kernel/perf_event_xscale.c | 8 |
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 | */ |
35 | DEFINE_SPINLOCK(pmu_lock); | 35 | static 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 | }; |
68 | DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events); | 68 | static DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events); |
69 | 69 | ||
70 | struct arm_pmu { | 70 | struct 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 | */ |
675 | struct frame_tail { | 675 | struct 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 | */ |
685 | static struct frame_tail * | 685 | static struct frame_tail __user * |
686 | user_backtrace(struct frame_tail *tail, | 686 | user_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, | |||
709 | void | 709 | void |
710 | perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) | 710 | perf_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 | ||
403 | void | 403 | static void |
404 | armv6pmu_enable_event(struct hw_perf_event *hwc, | 404 | armv6pmu_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 | ||
628 | const struct arm_pmu *__init armv6pmu_init(void) | 628 | static 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 | ||
658 | const struct arm_pmu *__init armv6mpcore_pmu_init(void) | 658 | static 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 |
663 | const struct arm_pmu *__init armv6pmu_init(void) | 663 | static const struct arm_pmu *__init armv6pmu_init(void) |
664 | { | 664 | { |
665 | return NULL; | 665 | return NULL; |
666 | } | 666 | } |
667 | 667 | ||
668 | const struct arm_pmu *__init armv6mpcore_pmu_init(void) | 668 | static 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 | ||
684 | void armv7pmu_enable_event(struct hw_perf_event *hwc, int idx) | 684 | static 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 | ||
877 | const struct arm_pmu *__init armv7_a8_pmu_init(void) | 877 | static 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 | ||
887 | const struct arm_pmu *__init armv7_a9_pmu_init(void) | 887 | static 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 |
897 | const struct arm_pmu *__init armv7_a8_pmu_init(void) | 897 | static const struct arm_pmu *__init armv7_a8_pmu_init(void) |
898 | { | 898 | { |
899 | return NULL; | 899 | return NULL; |
900 | } | 900 | } |
901 | 901 | ||
902 | const struct arm_pmu *__init armv7_a9_pmu_init(void) | 902 | static 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 | ||
431 | const struct arm_pmu *__init xscale1pmu_init(void) | 431 | static 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 | ||
793 | const struct arm_pmu *__init xscale2pmu_init(void) | 793 | static const struct arm_pmu *__init xscale2pmu_init(void) |
794 | { | 794 | { |
795 | return &xscale2pmu; | 795 | return &xscale2pmu; |
796 | } | 796 | } |
797 | #else | 797 | #else |
798 | const struct arm_pmu *__init xscale1pmu_init(void) | 798 | static const struct arm_pmu *__init xscale1pmu_init(void) |
799 | { | 799 | { |
800 | return NULL; | 800 | return NULL; |
801 | } | 801 | } |
802 | 802 | ||
803 | const struct arm_pmu *__init xscale2pmu_init(void) | 803 | static const struct arm_pmu *__init xscale2pmu_init(void) |
804 | { | 804 | { |
805 | return NULL; | 805 | return NULL; |
806 | } | 806 | } |