diff options
author | Helge Deller <deller@parisc-linux.org> | 2006-01-17 14:40:40 -0500 |
---|---|---|
committer | Kyle McMartin <kyle@duet.int.mcmartin.ca> | 2006-01-22 20:26:31 -0500 |
commit | cb6fc18e9ca615f03d18e60c49855b434ca2e51e (patch) | |
tree | c35af13054f8eeb7a24c928edf55fdc69c912562 /arch/parisc/kernel/perf.c | |
parent | a1c744439591b1d4350f0926615d501e7cfbb708 (diff) |
[PARISC] Use kzalloc and other janitor-style cleanups
Helge,
o Convert a bunch of kmalloc/memset uses to kzalloc.
o pci.c: Add some __read_mostly annotations.
o pci.c: Move constant pci_post_reset_delay to asm/pci.h
o grfioctl.h: Add A4450A to comment of CRT_ID_VISUALIZE_EG.
o Add some consts to perf.c/perf_images.h
Matthew,
o sticore.c: Add some consts to suppress compile warnings.
Signed-off-by: Helge Deller <deller@parisc-linux.org>
Signed-off-by: Matthew Wilcox <willy@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'arch/parisc/kernel/perf.c')
-rw-r--r-- | arch/parisc/kernel/perf.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c index 11d406cd0b3e..11178ccbb89a 100644 --- a/arch/parisc/kernel/perf.c +++ b/arch/parisc/kernel/perf.c | |||
@@ -68,20 +68,20 @@ struct rdr_tbl_ent { | |||
68 | }; | 68 | }; |
69 | 69 | ||
70 | static int perf_processor_interface __read_mostly = UNKNOWN_INTF; | 70 | static int perf_processor_interface __read_mostly = UNKNOWN_INTF; |
71 | static int perf_enabled __read_mostly = 0; | 71 | static int perf_enabled __read_mostly; |
72 | static spinlock_t perf_lock; | 72 | static spinlock_t perf_lock; |
73 | struct parisc_device *cpu_device __read_mostly = NULL; | 73 | struct parisc_device *cpu_device __read_mostly; |
74 | 74 | ||
75 | /* RDRs to write for PCX-W */ | 75 | /* RDRs to write for PCX-W */ |
76 | static int perf_rdrs_W[] = | 76 | static const int perf_rdrs_W[] = |
77 | { 0, 1, 4, 5, 6, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, -1 }; | 77 | { 0, 1, 4, 5, 6, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, -1 }; |
78 | 78 | ||
79 | /* RDRs to write for PCX-U */ | 79 | /* RDRs to write for PCX-U */ |
80 | static int perf_rdrs_U[] = | 80 | static const int perf_rdrs_U[] = |
81 | { 0, 1, 4, 5, 6, 7, 16, 17, 18, 20, 21, 22, 23, 24, 25, -1 }; | 81 | { 0, 1, 4, 5, 6, 7, 16, 17, 18, 20, 21, 22, 23, 24, 25, -1 }; |
82 | 82 | ||
83 | /* RDR register descriptions for PCX-W */ | 83 | /* RDR register descriptions for PCX-W */ |
84 | static struct rdr_tbl_ent perf_rdr_tbl_W[] = { | 84 | static const struct rdr_tbl_ent perf_rdr_tbl_W[] = { |
85 | { 19, 1, 8 }, /* RDR 0 */ | 85 | { 19, 1, 8 }, /* RDR 0 */ |
86 | { 16, 1, 16 }, /* RDR 1 */ | 86 | { 16, 1, 16 }, /* RDR 1 */ |
87 | { 72, 2, 0 }, /* RDR 2 */ | 87 | { 72, 2, 0 }, /* RDR 2 */ |
@@ -117,7 +117,7 @@ static struct rdr_tbl_ent perf_rdr_tbl_W[] = { | |||
117 | }; | 117 | }; |
118 | 118 | ||
119 | /* RDR register descriptions for PCX-U */ | 119 | /* RDR register descriptions for PCX-U */ |
120 | static struct rdr_tbl_ent perf_rdr_tbl_U[] = { | 120 | static const struct rdr_tbl_ent perf_rdr_tbl_U[] = { |
121 | { 19, 1, 8 }, /* RDR 0 */ | 121 | { 19, 1, 8 }, /* RDR 0 */ |
122 | { 32, 1, 16 }, /* RDR 1 */ | 122 | { 32, 1, 16 }, /* RDR 1 */ |
123 | { 20, 1, 0 }, /* RDR 2 */ | 123 | { 20, 1, 0 }, /* RDR 2 */ |
@@ -156,7 +156,7 @@ static struct rdr_tbl_ent perf_rdr_tbl_U[] = { | |||
156 | * A non-zero write_control in the above tables is a byte offset into | 156 | * A non-zero write_control in the above tables is a byte offset into |
157 | * this array. | 157 | * this array. |
158 | */ | 158 | */ |
159 | static uint64_t perf_bitmasks[] = { | 159 | static const uint64_t perf_bitmasks[] = { |
160 | 0x0000000000000000ul, /* first dbl word must be zero */ | 160 | 0x0000000000000000ul, /* first dbl word must be zero */ |
161 | 0xfdffe00000000000ul, /* RDR0 bitmask */ | 161 | 0xfdffe00000000000ul, /* RDR0 bitmask */ |
162 | 0x003f000000000000ul, /* RDR1 bitmask */ | 162 | 0x003f000000000000ul, /* RDR1 bitmask */ |
@@ -173,7 +173,7 @@ static uint64_t perf_bitmasks[] = { | |||
173 | * Write control bitmasks for Pa-8700 processor given | 173 | * Write control bitmasks for Pa-8700 processor given |
174 | * somethings have changed slightly. | 174 | * somethings have changed slightly. |
175 | */ | 175 | */ |
176 | static uint64_t perf_bitmasks_piranha[] = { | 176 | static const uint64_t perf_bitmasks_piranha[] = { |
177 | 0x0000000000000000ul, /* first dbl word must be zero */ | 177 | 0x0000000000000000ul, /* first dbl word must be zero */ |
178 | 0xfdffe00000000000ul, /* RDR0 bitmask */ | 178 | 0xfdffe00000000000ul, /* RDR0 bitmask */ |
179 | 0x003f000000000000ul, /* RDR1 bitmask */ | 179 | 0x003f000000000000ul, /* RDR1 bitmask */ |
@@ -186,7 +186,7 @@ static uint64_t perf_bitmasks_piranha[] = { | |||
186 | 0xfffc000000000000ul | 186 | 0xfffc000000000000ul |
187 | }; | 187 | }; |
188 | 188 | ||
189 | static uint64_t *bitmask_array; /* array of bitmasks to use */ | 189 | static const uint64_t *bitmask_array; /* array of bitmasks to use */ |
190 | 190 | ||
191 | /****************************************************************************** | 191 | /****************************************************************************** |
192 | * Function Prototypes | 192 | * Function Prototypes |
@@ -200,7 +200,7 @@ static ssize_t perf_write(struct file *file, const char __user *buf, size_t coun | |||
200 | static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg); | 200 | static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
201 | static void perf_start_counters(void); | 201 | static void perf_start_counters(void); |
202 | static int perf_stop_counters(uint32_t *raddr); | 202 | static int perf_stop_counters(uint32_t *raddr); |
203 | static struct rdr_tbl_ent * perf_rdr_get_entry(uint32_t rdr_num); | 203 | static const struct rdr_tbl_ent * perf_rdr_get_entry(uint32_t rdr_num); |
204 | static int perf_rdr_read_ubuf(uint32_t rdr_num, uint64_t *buffer); | 204 | static int perf_rdr_read_ubuf(uint32_t rdr_num, uint64_t *buffer); |
205 | static int perf_rdr_clear(uint32_t rdr_num); | 205 | static int perf_rdr_clear(uint32_t rdr_num); |
206 | static int perf_write_image(uint64_t *memaddr); | 206 | static int perf_write_image(uint64_t *memaddr); |
@@ -655,7 +655,7 @@ static int perf_stop_counters(uint32_t *raddr) | |||
655 | * Retrieve a pointer to the description of what this | 655 | * Retrieve a pointer to the description of what this |
656 | * RDR contains. | 656 | * RDR contains. |
657 | */ | 657 | */ |
658 | static struct rdr_tbl_ent * perf_rdr_get_entry(uint32_t rdr_num) | 658 | static const struct rdr_tbl_ent * perf_rdr_get_entry(uint32_t rdr_num) |
659 | { | 659 | { |
660 | if (perf_processor_interface == ONYX_INTF) { | 660 | if (perf_processor_interface == ONYX_INTF) { |
661 | return &perf_rdr_tbl_U[rdr_num]; | 661 | return &perf_rdr_tbl_U[rdr_num]; |
@@ -673,7 +673,7 @@ static int perf_rdr_read_ubuf(uint32_t rdr_num, uint64_t *buffer) | |||
673 | { | 673 | { |
674 | uint64_t data, data_mask = 0; | 674 | uint64_t data, data_mask = 0; |
675 | uint32_t width, xbits, i; | 675 | uint32_t width, xbits, i; |
676 | struct rdr_tbl_ent *tentry; | 676 | const struct rdr_tbl_ent *tentry; |
677 | 677 | ||
678 | tentry = perf_rdr_get_entry(rdr_num); | 678 | tentry = perf_rdr_get_entry(rdr_num); |
679 | if ((width = tentry->width) == 0) | 679 | if ((width = tentry->width) == 0) |
@@ -721,7 +721,7 @@ static int perf_rdr_read_ubuf(uint32_t rdr_num, uint64_t *buffer) | |||
721 | */ | 721 | */ |
722 | static int perf_rdr_clear(uint32_t rdr_num) | 722 | static int perf_rdr_clear(uint32_t rdr_num) |
723 | { | 723 | { |
724 | struct rdr_tbl_ent *tentry; | 724 | const struct rdr_tbl_ent *tentry; |
725 | int32_t i; | 725 | int32_t i; |
726 | 726 | ||
727 | tentry = perf_rdr_get_entry(rdr_num); | 727 | tentry = perf_rdr_get_entry(rdr_num); |
@@ -753,10 +753,11 @@ static int perf_write_image(uint64_t *memaddr) | |||
753 | uint64_t buffer[MAX_RDR_WORDS]; | 753 | uint64_t buffer[MAX_RDR_WORDS]; |
754 | uint64_t *bptr; | 754 | uint64_t *bptr; |
755 | uint32_t dwords; | 755 | uint32_t dwords; |
756 | uint32_t *intrigue_rdr; | 756 | const uint32_t *intrigue_rdr; |
757 | uint64_t *intrigue_bitmask, tmp64; | 757 | const uint64_t *intrigue_bitmask; |
758 | uint64_t tmp64; | ||
758 | void __iomem *runway; | 759 | void __iomem *runway; |
759 | struct rdr_tbl_ent *tentry; | 760 | const struct rdr_tbl_ent *tentry; |
760 | int i; | 761 | int i; |
761 | 762 | ||
762 | /* Clear out counters */ | 763 | /* Clear out counters */ |
@@ -830,7 +831,7 @@ static int perf_write_image(uint64_t *memaddr) | |||
830 | */ | 831 | */ |
831 | static void perf_rdr_write(uint32_t rdr_num, uint64_t *buffer) | 832 | static void perf_rdr_write(uint32_t rdr_num, uint64_t *buffer) |
832 | { | 833 | { |
833 | struct rdr_tbl_ent *tentry; | 834 | const struct rdr_tbl_ent *tentry; |
834 | int32_t i; | 835 | int32_t i; |
835 | 836 | ||
836 | printk("perf_rdr_write\n"); | 837 | printk("perf_rdr_write\n"); |