[PATCH 4.18 090/158] macintosh/via-pmu: Add missing mmio accessors
4.18-stable review patch. If anyone has any objections, please let me know. -- From: Finn Thain [ Upstream commit 576d5290d678a651b9f36050fc1717e0573aca13 ] Add missing in_8() accessors to init_pmu() and pmu_sr_intr(). This fixes several sparse warnings: drivers/macintosh/via-pmu.c:536:29: warning: dereference of noderef expression drivers/macintosh/via-pmu.c:537:33: warning: dereference of noderef expression drivers/macintosh/via-pmu.c:1455:17: warning: dereference of noderef expression drivers/macintosh/via-pmu.c:1456:69: warning: dereference of noderef expression Tested-by: Stan Johnson Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/macintosh/via-pmu.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -534,8 +534,9 @@ init_pmu(void) int timeout; struct adb_request req; - out_8([B], via[B] | TREQ); /* negate TREQ */ - out_8([DIRB], (via[DIRB] | TREQ) & ~TACK); /* TACK in, TREQ out */ + /* Negate TREQ. Set TACK to input and TREQ to output. */ + out_8([B], in_8([B]) | TREQ); + out_8([DIRB], (in_8([DIRB]) | TREQ) & ~TACK); pmu_request(, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask); timeout = 10; @@ -1418,8 +1419,8 @@ pmu_sr_intr(void) struct adb_request *req; int bite = 0; - if (via[B] & TREQ) { - printk(KERN_ERR "PMU: spurious SR intr (%x)\n", via[B]); + if (in_8([B]) & TREQ) { + printk(KERN_ERR "PMU: spurious SR intr (%x)\n", in_8([B])); out_8([IFR], SR_INT); return NULL; }
[PATCH 4.18 090/158] macintosh/via-pmu: Add missing mmio accessors
4.18-stable review patch. If anyone has any objections, please let me know. -- From: Finn Thain [ Upstream commit 576d5290d678a651b9f36050fc1717e0573aca13 ] Add missing in_8() accessors to init_pmu() and pmu_sr_intr(). This fixes several sparse warnings: drivers/macintosh/via-pmu.c:536:29: warning: dereference of noderef expression drivers/macintosh/via-pmu.c:537:33: warning: dereference of noderef expression drivers/macintosh/via-pmu.c:1455:17: warning: dereference of noderef expression drivers/macintosh/via-pmu.c:1456:69: warning: dereference of noderef expression Tested-by: Stan Johnson Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/macintosh/via-pmu.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -534,8 +534,9 @@ init_pmu(void) int timeout; struct adb_request req; - out_8([B], via[B] | TREQ); /* negate TREQ */ - out_8([DIRB], (via[DIRB] | TREQ) & ~TACK); /* TACK in, TREQ out */ + /* Negate TREQ. Set TACK to input and TREQ to output. */ + out_8([B], in_8([B]) | TREQ); + out_8([DIRB], (in_8([DIRB]) | TREQ) & ~TACK); pmu_request(, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask); timeout = 10; @@ -1418,8 +1419,8 @@ pmu_sr_intr(void) struct adb_request *req; int bite = 0; - if (via[B] & TREQ) { - printk(KERN_ERR "PMU: spurious SR intr (%x)\n", via[B]); + if (in_8([B]) & TREQ) { + printk(KERN_ERR "PMU: spurious SR intr (%x)\n", in_8([B])); out_8([IFR], SR_INT); return NULL; }