Commit 07e694d
bpf: replace usage of found with dedicated list iterator variable
To move the list iterator variable into the list_for_each_entry_*()
macro in the future it should be avoided to use the list iterator
variable after the loop body.
To *never* use the list iterator variable after the loop it was
concluded to use a separate iterator variable instead of a
found boolean [1].
This removes the need to use a found variable (supported & existed)
and simply checking if the variable was set, can determine if the
break/goto was hit.
Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/
Signed-off-by: Jakob Koschel <jakobkoschel@gmail.com>
Acked-by: Yonghong Song <yhs@fb.com>1 parent 9f3f9b4 commit 07e694d
1 file changed
+14
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
333 | 334 | | |
334 | 335 | | |
335 | | - | |
336 | 336 | | |
337 | | - | |
338 | 337 | | |
339 | 338 | | |
340 | 339 | | |
341 | 340 | | |
342 | 341 | | |
343 | | - | |
344 | | - | |
345 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
346 | 345 | | |
347 | 346 | | |
348 | | - | |
349 | | - | |
350 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
351 | 350 | | |
352 | 351 | | |
353 | 352 | | |
354 | 353 | | |
355 | 354 | | |
356 | | - | |
| 355 | + | |
357 | 356 | | |
358 | 357 | | |
359 | 358 | | |
360 | 359 | | |
361 | | - | |
| 360 | + | |
362 | 361 | | |
363 | 362 | | |
364 | 363 | | |
| |||
499 | 498 | | |
500 | 499 | | |
501 | 500 | | |
| 501 | + | |
502 | 502 | | |
503 | | - | |
504 | 503 | | |
505 | 504 | | |
506 | 505 | | |
507 | | - | |
508 | 506 | | |
509 | 507 | | |
510 | 508 | | |
| |||
530 | 528 | | |
531 | 529 | | |
532 | 530 | | |
533 | | - | |
534 | | - | |
535 | | - | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
536 | 534 | | |
537 | 535 | | |
538 | 536 | | |
539 | 537 | | |
540 | | - | |
| 538 | + | |
541 | 539 | | |
542 | 540 | | |
543 | 541 | | |
| |||
0 commit comments