Commit 479d8e6
mmc: mmci: Unwind big if() clause
This does two things: firsr replace the hard-to-read long
if-expression:
if (!host->busy_status && !(status & err_msk) &&
(readl(base + MMCISTATUS) & host->variant->busy_detect_flag)) {
With the more readable:
if (!host->busy_status && !(status & err_msk)) {
status = readl(base + MMCISTATUS);
if (status & host->variant->busy_detect_flag) {
Second notice that the re-read MMCISTATUS register is now
stored into the status variable, using logic OR because what
if something else changed too?
While we are at it, explain what the function is doing.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230405-pl180-busydetect-fix-v7-2-69a7164f2a61@linaro.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>1 parent 2673493 commit 479d8e6
1 file changed
Lines changed: 26 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
657 | 674 | | |
658 | 675 | | |
659 | 676 | | |
| |||
671 | 688 | | |
672 | 689 | | |
673 | 690 | | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
679 | 697 | | |
680 | | - | |
681 | | - | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
682 | 701 | | |
683 | 702 | | |
684 | 703 | | |
| |||
0 commit comments