@@ -245,9 +245,9 @@ static void pmc_core_slps0_display(struct pmc *pmc, struct device *dev,
245
245
}
246
246
}
247
247
248
- static int pmc_core_lpm_get_arr_size (const struct pmc_bit_map * * maps )
248
+ static unsigned int pmc_core_lpm_get_arr_size (const struct pmc_bit_map * * maps )
249
249
{
250
- int idx ;
250
+ unsigned int idx ;
251
251
252
252
for (idx = 0 ; maps [idx ]; idx ++ )
253
253
;/* Nothing */
@@ -260,8 +260,8 @@ static void pmc_core_lpm_display(struct pmc *pmc, struct device *dev,
260
260
const char * str ,
261
261
const struct pmc_bit_map * * maps )
262
262
{
263
- int index , idx , len = 32 , bit_mask , arr_size ;
264
- u32 * lpm_regs ;
263
+ unsigned int index , idx , len = 32 , arr_size ;
264
+ u32 bit_mask , * lpm_regs ;
265
265
266
266
arr_size = pmc_core_lpm_get_arr_size (maps );
267
267
lpm_regs = kmalloc_array (arr_size , sizeof (* lpm_regs ), GFP_KERNEL );
@@ -314,13 +314,13 @@ static void pmc_core_display_map(struct seq_file *s, int index, int idx, int ip,
314
314
static int pmc_core_ppfear_show (struct seq_file * s , void * unused )
315
315
{
316
316
struct pmc_dev * pmcdev = s -> private ;
317
- int i ;
317
+ unsigned int i ;
318
318
319
319
for (i = 0 ; i < ARRAY_SIZE (pmcdev -> pmcs ); ++ i ) {
320
320
struct pmc * pmc = pmcdev -> pmcs [i ];
321
321
const struct pmc_bit_map * * maps ;
322
322
u8 pf_regs [PPFEAR_MAX_NUM_ENTRIES ];
323
- int index , iter , idx , ip = 0 ;
323
+ unsigned int index , iter , idx , ip = 0 ;
324
324
325
325
if (!pmc )
326
326
continue ;
@@ -379,7 +379,8 @@ static int pmc_core_mphy_pg_show(struct seq_file *s, void *unused)
379
379
const struct pmc_bit_map * map = pmc -> map -> mphy_sts ;
380
380
u32 mphy_core_reg_low , mphy_core_reg_high ;
381
381
u32 val_low , val_high ;
382
- int index , err = 0 ;
382
+ unsigned int index ;
383
+ int err = 0 ;
383
384
384
385
if (pmcdev -> pmc_xram_read_bit ) {
385
386
seq_puts (s , "Access denied: please disable PMC_READ_DISABLE setting in BIOS." );
@@ -429,7 +430,8 @@ static int pmc_core_pll_show(struct seq_file *s, void *unused)
429
430
struct pmc * pmc = pmcdev -> pmcs [PMC_IDX_MAIN ];
430
431
const struct pmc_bit_map * map = pmc -> map -> pll_sts ;
431
432
u32 mphy_common_reg , val ;
432
- int index , err = 0 ;
433
+ unsigned int index ;
434
+ int err = 0 ;
433
435
434
436
if (pmcdev -> pmc_xram_read_bit ) {
435
437
seq_puts (s , "Access denied: please disable PMC_READ_DISABLE setting in BIOS." );
@@ -462,7 +464,8 @@ int pmc_core_send_ltr_ignore(struct pmc_dev *pmcdev, u32 value, int ignore)
462
464
struct pmc * pmc ;
463
465
const struct pmc_reg_map * map ;
464
466
u32 reg ;
465
- int pmc_index , ltr_index ;
467
+ unsigned int pmc_index ;
468
+ int ltr_index ;
466
469
467
470
ltr_index = value ;
468
471
/* For platforms with multiple pmcs, ltr index value given by user
@@ -615,7 +618,7 @@ static int pmc_core_ltr_show(struct seq_file *s, void *unused)
615
618
u64 decoded_snoop_ltr , decoded_non_snoop_ltr ;
616
619
u32 ltr_raw_data , scale , val ;
617
620
u16 snoop_ltr , nonsnoop_ltr ;
618
- int i , index , ltr_index = 0 ;
621
+ unsigned int i , index , ltr_index = 0 ;
619
622
620
623
for (i = 0 ; i < ARRAY_SIZE (pmcdev -> pmcs ); ++ i ) {
621
624
struct pmc * pmc = pmcdev -> pmcs [i ];
@@ -703,7 +706,8 @@ static int pmc_core_substate_res_show(struct seq_file *s, void *unused)
703
706
struct pmc * pmc = pmcdev -> pmcs [PMC_IDX_MAIN ];
704
707
const int lpm_adj_x2 = pmc -> map -> lpm_res_counter_step_x2 ;
705
708
u32 offset = pmc -> map -> lpm_residency_offset ;
706
- int i , mode ;
709
+ unsigned int i ;
710
+ int mode ;
707
711
708
712
seq_printf (s , "%-10s %-15s\n" , "Substate" , "Residency" );
709
713
@@ -719,7 +723,7 @@ DEFINE_SHOW_ATTRIBUTE(pmc_core_substate_res);
719
723
static int pmc_core_substate_sts_regs_show (struct seq_file * s , void * unused )
720
724
{
721
725
struct pmc_dev * pmcdev = s -> private ;
722
- int i ;
726
+ unsigned int i ;
723
727
724
728
for (i = 0 ; i < ARRAY_SIZE (pmcdev -> pmcs ); ++ i ) {
725
729
struct pmc * pmc = pmcdev -> pmcs [i ];
@@ -740,7 +744,7 @@ DEFINE_SHOW_ATTRIBUTE(pmc_core_substate_sts_regs);
740
744
static int pmc_core_substate_l_sts_regs_show (struct seq_file * s , void * unused )
741
745
{
742
746
struct pmc_dev * pmcdev = s -> private ;
743
- int i ;
747
+ unsigned int i ;
744
748
745
749
for (i = 0 ; i < ARRAY_SIZE (pmcdev -> pmcs ); ++ i ) {
746
750
struct pmc * pmc = pmcdev -> pmcs [i ];
@@ -761,7 +765,8 @@ DEFINE_SHOW_ATTRIBUTE(pmc_core_substate_l_sts_regs);
761
765
static void pmc_core_substate_req_header_show (struct seq_file * s , int pmc_index )
762
766
{
763
767
struct pmc_dev * pmcdev = s -> private ;
764
- int i , mode ;
768
+ unsigned int i ;
769
+ int mode ;
765
770
766
771
seq_printf (s , "%30s |" , "Element" );
767
772
pmc_for_each_mode (i , mode , pmcdev )
@@ -775,7 +780,8 @@ static int pmc_core_substate_req_regs_show(struct seq_file *s, void *unused)
775
780
struct pmc_dev * pmcdev = s -> private ;
776
781
u32 sts_offset ;
777
782
u32 * lpm_req_regs ;
778
- int num_maps , mp , pmc_index ;
783
+ unsigned int mp , pmc_index ;
784
+ int num_maps ;
779
785
780
786
for (pmc_index = 0 ; pmc_index < ARRAY_SIZE (pmcdev -> pmcs ); ++ pmc_index ) {
781
787
struct pmc * pmc = pmcdev -> pmcs [pmc_index ];
@@ -897,9 +903,10 @@ static int pmc_core_lpm_latch_mode_show(struct seq_file *s, void *unused)
897
903
{
898
904
struct pmc_dev * pmcdev = s -> private ;
899
905
struct pmc * pmc = pmcdev -> pmcs [PMC_IDX_MAIN ];
906
+ unsigned int idx ;
900
907
bool c10 ;
901
908
u32 reg ;
902
- int idx , mode ;
909
+ int mode ;
903
910
904
911
reg = pmc_core_reg_read (pmc , pmc -> map -> lpm_sts_latch_en_offset );
905
912
if (reg & LPM_STS_LATCH_MODE ) {
@@ -931,7 +938,8 @@ static ssize_t pmc_core_lpm_latch_mode_write(struct file *file,
931
938
struct pmc * pmc = pmcdev -> pmcs [PMC_IDX_MAIN ];
932
939
bool clear = false, c10 = false;
933
940
unsigned char buf [8 ];
934
- int idx , m , mode ;
941
+ unsigned int idx ;
942
+ int m , mode ;
935
943
u32 reg ;
936
944
937
945
if (count > sizeof (buf ) - 1 )
@@ -999,7 +1007,7 @@ static int pmc_core_pkgc_show(struct seq_file *s, void *unused)
999
1007
struct pmc * pmc = s -> private ;
1000
1008
const struct pmc_bit_map * map = pmc -> map -> msr_sts ;
1001
1009
u64 pcstate_count ;
1002
- int index ;
1010
+ unsigned int index ;
1003
1011
1004
1012
for (index = 0 ; map [index ].name ; index ++ ) {
1005
1013
if (rdmsrl_safe (map [index ].bit_mask , & pcstate_count ))
@@ -1017,7 +1025,7 @@ DEFINE_SHOW_ATTRIBUTE(pmc_core_pkgc);
1017
1025
1018
1026
static bool pmc_core_pri_verify (u32 lpm_pri , u8 * mode_order )
1019
1027
{
1020
- int i , j ;
1028
+ unsigned int i , j ;
1021
1029
1022
1030
if (!lpm_pri )
1023
1031
return false;
@@ -1052,7 +1060,8 @@ void pmc_core_get_low_power_modes(struct pmc_dev *pmcdev)
1052
1060
u8 mode_order [LPM_MAX_NUM_MODES ];
1053
1061
u32 lpm_pri ;
1054
1062
u32 lpm_en ;
1055
- int mode , i , p ;
1063
+ unsigned int i ;
1064
+ int mode , p ;
1056
1065
1057
1066
/* Use LPM Maps to indicate support for substates */
1058
1067
if (!pmc -> map -> lpm_num_maps )
@@ -1344,7 +1353,7 @@ static void pmc_core_do_dmi_quirks(struct pmc *pmc)
1344
1353
static void pmc_core_clean_structure (struct platform_device * pdev )
1345
1354
{
1346
1355
struct pmc_dev * pmcdev = platform_get_drvdata (pdev );
1347
- int i ;
1356
+ unsigned int i ;
1348
1357
1349
1358
for (i = 0 ; i < ARRAY_SIZE (pmcdev -> pmcs ); ++ i ) {
1350
1359
struct pmc * pmc = pmcdev -> pmcs [i ];
@@ -1507,7 +1516,7 @@ int pmc_core_resume_common(struct pmc_dev *pmcdev)
1507
1516
struct pmc * pmc = pmcdev -> pmcs [PMC_IDX_MAIN ];
1508
1517
const struct pmc_bit_map * * maps = pmc -> map -> lpm_sts ;
1509
1518
int offset = pmc -> map -> lpm_status_offset ;
1510
- int i ;
1519
+ unsigned int i ;
1511
1520
1512
1521
/* Check if the syspend used S0ix */
1513
1522
if (pm_suspend_via_firmware ())
0 commit comments