Commit c17af96
committed
btrfs: raid56: simplify tracking of Q stripe presence
There are temporary variables tracking the index of P and Q stripes, but
none of them is really used as such, merely for determining if the Q
stripe is present. This leads to compiler warnings with
-Wunused-but-set-variable and has been reported several times.
fs/btrfs/raid56.c: In function ‘finish_rmw’:
fs/btrfs/raid56.c:1199:6: warning: variable ‘p_stripe’ set but not used [-Wunused-but-set-variable]
1199 | int p_stripe = -1;
| ^~~~~~~~
fs/btrfs/raid56.c: In function ‘finish_parity_scrub’:
fs/btrfs/raid56.c:2356:6: warning: variable ‘p_stripe’ set but not used [-Wunused-but-set-variable]
2356 | int p_stripe = -1;
| ^~~~~~~~
Replace the two variables with one that has a clear meaning and also get
rid of the warnings. The logic that verifies that there are only 2
valid cases is unchanged.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent b25b0b8 commit c17af96
1 file changed
Lines changed: 15 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1196 | 1196 | | |
1197 | 1197 | | |
1198 | 1198 | | |
1199 | | - | |
1200 | | - | |
| 1199 | + | |
1201 | 1200 | | |
1202 | 1201 | | |
1203 | 1202 | | |
1204 | 1203 | | |
1205 | 1204 | | |
1206 | 1205 | | |
1207 | | - | |
1208 | | - | |
1209 | | - | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
1213 | 1211 | | |
1214 | | - | |
1215 | 1212 | | |
1216 | 1213 | | |
1217 | 1214 | | |
| |||
1255 | 1252 | | |
1256 | 1253 | | |
1257 | 1254 | | |
1258 | | - | |
| 1255 | + | |
1259 | 1256 | | |
1260 | 1257 | | |
1261 | 1258 | | |
| |||
2353 | 2350 | | |
2354 | 2351 | | |
2355 | 2352 | | |
2356 | | - | |
2357 | | - | |
| 2353 | + | |
2358 | 2354 | | |
2359 | 2355 | | |
2360 | 2356 | | |
| |||
2364 | 2360 | | |
2365 | 2361 | | |
2366 | 2362 | | |
2367 | | - | |
2368 | | - | |
2369 | | - | |
2370 | | - | |
2371 | | - | |
2372 | | - | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
2373 | 2368 | | |
2374 | | - | |
2375 | 2369 | | |
2376 | 2370 | | |
2377 | 2371 | | |
| |||
2393 | 2387 | | |
2394 | 2388 | | |
2395 | 2389 | | |
2396 | | - | |
| 2390 | + | |
2397 | 2391 | | |
2398 | 2392 | | |
2399 | 2393 | | |
| |||
2416 | 2410 | | |
2417 | 2411 | | |
2418 | 2412 | | |
2419 | | - | |
2420 | | - | |
| 2413 | + | |
2421 | 2414 | | |
2422 | 2415 | | |
2423 | 2416 | | |
| |||
0 commit comments