@@ -68,20 +68,20 @@ struct rdr_tbl_ent {
6868};
6969
7070static int perf_processor_interface __read_mostly = UNKNOWN_INTF ;
71- static int perf_enabled __read_mostly = 0 ;
71+ static int perf_enabled __read_mostly ;
7272static spinlock_t perf_lock ;
73- struct parisc_device * cpu_device __read_mostly = NULL ;
73+ struct parisc_device * cpu_device __read_mostly ;
7474
7575/* RDRs to write for PCX-W */
76- static int perf_rdrs_W [] =
76+ static const int perf_rdrs_W [] =
7777 { 0 , 1 , 4 , 5 , 6 , 15 , 16 , 17 , 18 , 20 , 21 , 22 , 23 , 24 , 25 , -1 };
7878
7979/* RDRs to write for PCX-U */
80- static int perf_rdrs_U [] =
80+ static const int perf_rdrs_U [] =
8181 { 0 , 1 , 4 , 5 , 6 , 7 , 16 , 17 , 18 , 20 , 21 , 22 , 23 , 24 , 25 , -1 };
8282
8383/* 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 [] = {
8585 { 19 , 1 , 8 }, /* RDR 0 */
8686 { 16 , 1 , 16 }, /* RDR 1 */
8787 { 72 , 2 , 0 }, /* RDR 2 */
@@ -117,7 +117,7 @@ static struct rdr_tbl_ent perf_rdr_tbl_W[] = {
117117};
118118
119119/* 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 [] = {
121121 { 19 , 1 , 8 }, /* RDR 0 */
122122 { 32 , 1 , 16 }, /* RDR 1 */
123123 { 20 , 1 , 0 }, /* RDR 2 */
@@ -156,7 +156,7 @@ static struct rdr_tbl_ent perf_rdr_tbl_U[] = {
156156 * A non-zero write_control in the above tables is a byte offset into
157157 * this array.
158158 */
159- static uint64_t perf_bitmasks [] = {
159+ static const uint64_t perf_bitmasks [] = {
160160 0x0000000000000000ul , /* first dbl word must be zero */
161161 0xfdffe00000000000ul , /* RDR0 bitmask */
162162 0x003f000000000000ul , /* RDR1 bitmask */
@@ -173,7 +173,7 @@ static uint64_t perf_bitmasks[] = {
173173 * Write control bitmasks for Pa-8700 processor given
174174 * somethings have changed slightly.
175175 */
176- static uint64_t perf_bitmasks_piranha [] = {
176+ static const uint64_t perf_bitmasks_piranha [] = {
177177 0x0000000000000000ul , /* first dbl word must be zero */
178178 0xfdffe00000000000ul , /* RDR0 bitmask */
179179 0x003f000000000000ul , /* RDR1 bitmask */
@@ -186,7 +186,7 @@ static uint64_t perf_bitmasks_piranha[] = {
186186 0xfffc000000000000ul
187187};
188188
189- static uint64_t * bitmask_array ; /* array of bitmasks to use */
189+ static const uint64_t * bitmask_array ; /* array of bitmasks to use */
190190
191191/******************************************************************************
192192 * Function Prototypes
@@ -200,7 +200,7 @@ static ssize_t perf_write(struct file *file, const char __user *buf, size_t coun
200200static long perf_ioctl (struct file * file , unsigned int cmd , unsigned long arg );
201201static void perf_start_counters (void );
202202static 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 );
204204static int perf_rdr_read_ubuf (uint32_t rdr_num , uint64_t * buffer );
205205static int perf_rdr_clear (uint32_t rdr_num );
206206static int perf_write_image (uint64_t * memaddr );
@@ -655,7 +655,7 @@ static int perf_stop_counters(uint32_t *raddr)
655655 * Retrieve a pointer to the description of what this
656656 * RDR contains.
657657 */
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 )
659659{
660660 if (perf_processor_interface == ONYX_INTF ) {
661661 return & perf_rdr_tbl_U [rdr_num ];
@@ -673,7 +673,7 @@ static int perf_rdr_read_ubuf(uint32_t rdr_num, uint64_t *buffer)
673673{
674674 uint64_t data , data_mask = 0 ;
675675 uint32_t width , xbits , i ;
676- struct rdr_tbl_ent * tentry ;
676+ const struct rdr_tbl_ent * tentry ;
677677
678678 tentry = perf_rdr_get_entry (rdr_num );
679679 if ((width = tentry -> width ) == 0 )
@@ -721,7 +721,7 @@ static int perf_rdr_read_ubuf(uint32_t rdr_num, uint64_t *buffer)
721721 */
722722static int perf_rdr_clear (uint32_t rdr_num )
723723{
724- struct rdr_tbl_ent * tentry ;
724+ const struct rdr_tbl_ent * tentry ;
725725 int32_t i ;
726726
727727 tentry = perf_rdr_get_entry (rdr_num );
@@ -753,10 +753,11 @@ static int perf_write_image(uint64_t *memaddr)
753753 uint64_t buffer [MAX_RDR_WORDS ];
754754 uint64_t * bptr ;
755755 uint32_t dwords ;
756- uint32_t * intrigue_rdr ;
757- uint64_t * intrigue_bitmask , tmp64 ;
756+ const uint32_t * intrigue_rdr ;
757+ const uint64_t * intrigue_bitmask ;
758+ uint64_t tmp64 ;
758759 void __iomem * runway ;
759- struct rdr_tbl_ent * tentry ;
760+ const struct rdr_tbl_ent * tentry ;
760761 int i ;
761762
762763 /* Clear out counters */
@@ -830,7 +831,7 @@ static int perf_write_image(uint64_t *memaddr)
830831 */
831832static void perf_rdr_write (uint32_t rdr_num , uint64_t * buffer )
832833{
833- struct rdr_tbl_ent * tentry ;
834+ const struct rdr_tbl_ent * tentry ;
834835 int32_t i ;
835836
836837printk ("perf_rdr_write\n" );
0 commit comments