@@ -601,7 +601,7 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
601
601
struct ubi_ainf_peb * aeb , * tmp_aeb , * _tmp_aeb ;
602
602
struct ubi_fm_sb * fmsb ;
603
603
struct ubi_fm_hdr * fmhdr ;
604
- struct ubi_fm_scan_pool * fmpl1 , * fmpl2 ;
604
+ struct ubi_fm_scan_pool * fmpl , * fmpl_wl ;
605
605
struct ubi_fm_ec * fmec ;
606
606
struct ubi_fm_volhdr * fmvhdr ;
607
607
struct ubi_fm_eba * fm_eba ;
@@ -631,30 +631,30 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
631
631
goto fail_bad ;
632
632
}
633
633
634
- fmpl1 = (struct ubi_fm_scan_pool * )(fm_raw + fm_pos );
635
- fm_pos += sizeof (* fmpl1 );
634
+ fmpl = (struct ubi_fm_scan_pool * )(fm_raw + fm_pos );
635
+ fm_pos += sizeof (* fmpl );
636
636
if (fm_pos >= fm_size )
637
637
goto fail_bad ;
638
- if (be32_to_cpu (fmpl1 -> magic ) != UBI_FM_POOL_MAGIC ) {
638
+ if (be32_to_cpu (fmpl -> magic ) != UBI_FM_POOL_MAGIC ) {
639
639
ubi_err (ubi , "bad fastmap pool magic: 0x%x, expected: 0x%x" ,
640
- be32_to_cpu (fmpl1 -> magic ), UBI_FM_POOL_MAGIC );
640
+ be32_to_cpu (fmpl -> magic ), UBI_FM_POOL_MAGIC );
641
641
goto fail_bad ;
642
642
}
643
643
644
- fmpl2 = (struct ubi_fm_scan_pool * )(fm_raw + fm_pos );
645
- fm_pos += sizeof (* fmpl2 );
644
+ fmpl_wl = (struct ubi_fm_scan_pool * )(fm_raw + fm_pos );
645
+ fm_pos += sizeof (* fmpl_wl );
646
646
if (fm_pos >= fm_size )
647
647
goto fail_bad ;
648
- if (be32_to_cpu (fmpl2 -> magic ) != UBI_FM_POOL_MAGIC ) {
649
- ubi_err (ubi , "bad fastmap pool magic: 0x%x, expected: 0x%x" ,
650
- be32_to_cpu (fmpl2 -> magic ), UBI_FM_POOL_MAGIC );
648
+ if (be32_to_cpu (fmpl_wl -> magic ) != UBI_FM_POOL_MAGIC ) {
649
+ ubi_err (ubi , "bad fastmap WL pool magic: 0x%x, expected: 0x%x" ,
650
+ be32_to_cpu (fmpl_wl -> magic ), UBI_FM_POOL_MAGIC );
651
651
goto fail_bad ;
652
652
}
653
653
654
- pool_size = be16_to_cpu (fmpl1 -> size );
655
- wl_pool_size = be16_to_cpu (fmpl2 -> size );
656
- fm -> max_pool_size = be16_to_cpu (fmpl1 -> max_size );
657
- fm -> max_wl_pool_size = be16_to_cpu (fmpl2 -> max_size );
654
+ pool_size = be16_to_cpu (fmpl -> size );
655
+ wl_pool_size = be16_to_cpu (fmpl_wl -> size );
656
+ fm -> max_pool_size = be16_to_cpu (fmpl -> max_size );
657
+ fm -> max_wl_pool_size = be16_to_cpu (fmpl_wl -> max_size );
658
658
659
659
if (pool_size > UBI_FM_MAX_POOL_SIZE || pool_size < 0 ) {
660
660
ubi_err (ubi , "bad pool size: %i" , pool_size );
@@ -796,11 +796,11 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
796
796
}
797
797
}
798
798
799
- ret = scan_pool (ubi , ai , fmpl1 -> pebs , pool_size , & max_sqnum , & free );
799
+ ret = scan_pool (ubi , ai , fmpl -> pebs , pool_size , & max_sqnum , & free );
800
800
if (ret )
801
801
goto fail ;
802
802
803
- ret = scan_pool (ubi , ai , fmpl2 -> pebs , wl_pool_size , & max_sqnum , & free );
803
+ ret = scan_pool (ubi , ai , fmpl_wl -> pebs , wl_pool_size , & max_sqnum , & free );
804
804
if (ret )
805
805
goto fail ;
806
806
@@ -1083,7 +1083,7 @@ static int ubi_write_fastmap(struct ubi_device *ubi,
1083
1083
void * fm_raw ;
1084
1084
struct ubi_fm_sb * fmsb ;
1085
1085
struct ubi_fm_hdr * fmh ;
1086
- struct ubi_fm_scan_pool * fmpl1 , * fmpl2 ;
1086
+ struct ubi_fm_scan_pool * fmpl , * fmpl_wl ;
1087
1087
struct ubi_fm_ec * fec ;
1088
1088
struct ubi_fm_volhdr * fvh ;
1089
1089
struct ubi_fm_eba * feba ;
@@ -1141,25 +1141,25 @@ static int ubi_write_fastmap(struct ubi_device *ubi,
1141
1141
erase_peb_count = 0 ;
1142
1142
vol_count = 0 ;
1143
1143
1144
- fmpl1 = (struct ubi_fm_scan_pool * )(fm_raw + fm_pos );
1145
- fm_pos += sizeof (* fmpl1 );
1146
- fmpl1 -> magic = cpu_to_be32 (UBI_FM_POOL_MAGIC );
1147
- fmpl1 -> size = cpu_to_be16 (ubi -> fm_pool .size );
1148
- fmpl1 -> max_size = cpu_to_be16 (ubi -> fm_pool .max_size );
1144
+ fmpl = (struct ubi_fm_scan_pool * )(fm_raw + fm_pos );
1145
+ fm_pos += sizeof (* fmpl );
1146
+ fmpl -> magic = cpu_to_be32 (UBI_FM_POOL_MAGIC );
1147
+ fmpl -> size = cpu_to_be16 (ubi -> fm_pool .size );
1148
+ fmpl -> max_size = cpu_to_be16 (ubi -> fm_pool .max_size );
1149
1149
1150
1150
for (i = 0 ; i < ubi -> fm_pool .size ; i ++ ) {
1151
- fmpl1 -> pebs [i ] = cpu_to_be32 (ubi -> fm_pool .pebs [i ]);
1151
+ fmpl -> pebs [i ] = cpu_to_be32 (ubi -> fm_pool .pebs [i ]);
1152
1152
set_seen (ubi , ubi -> fm_pool .pebs [i ], seen_pebs );
1153
1153
}
1154
1154
1155
- fmpl2 = (struct ubi_fm_scan_pool * )(fm_raw + fm_pos );
1156
- fm_pos += sizeof (* fmpl2 );
1157
- fmpl2 -> magic = cpu_to_be32 (UBI_FM_POOL_MAGIC );
1158
- fmpl2 -> size = cpu_to_be16 (ubi -> fm_wl_pool .size );
1159
- fmpl2 -> max_size = cpu_to_be16 (ubi -> fm_wl_pool .max_size );
1155
+ fmpl_wl = (struct ubi_fm_scan_pool * )(fm_raw + fm_pos );
1156
+ fm_pos += sizeof (* fmpl_wl );
1157
+ fmpl_wl -> magic = cpu_to_be32 (UBI_FM_POOL_MAGIC );
1158
+ fmpl_wl -> size = cpu_to_be16 (ubi -> fm_wl_pool .size );
1159
+ fmpl_wl -> max_size = cpu_to_be16 (ubi -> fm_wl_pool .max_size );
1160
1160
1161
1161
for (i = 0 ; i < ubi -> fm_wl_pool .size ; i ++ ) {
1162
- fmpl2 -> pebs [i ] = cpu_to_be32 (ubi -> fm_wl_pool .pebs [i ]);
1162
+ fmpl_wl -> pebs [i ] = cpu_to_be32 (ubi -> fm_wl_pool .pebs [i ]);
1163
1163
set_seen (ubi , ubi -> fm_wl_pool .pebs [i ], seen_pebs );
1164
1164
}
1165
1165
0 commit comments