From: Dan Carpenter Date: Wed, 28 Jun 2017 11:49:07 +0000 (+0300) Subject: powerpc/83xx: Use sizeof correct type when ioremapping X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c65540453e150844367ffe98e45d5175181b2ec1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git powerpc/83xx: Use sizeof correct type when ioremapping There is a cut and paste error here so we use sizeof(struct mpc83xx_pmc) to remap the memory for "clock_regs". That sizeof() is 20 bytes and we only need to remap 12 bytes. It presumably doesn't affect run time too much... I changed them to both use sizeof(*variable_name) because that's the preferred kernel style these days. Fixes: d49747bdfb2d ("powerpc/mpc83xx: Power Management support") Signed-off-by: Dan Carpenter [mpe: It will map at least one page anyway, but still a good cleanup] Signed-off-by: Michael Ellerman --- diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c index 978b85bb3233..7fa3e197871a 100644 --- a/arch/powerpc/platforms/83xx/suspend.c +++ b/arch/powerpc/platforms/83xx/suspend.c @@ -361,7 +361,7 @@ static int pmc_probe(struct platform_device *ofdev) return -EBUSY; } - pmc_regs = ioremap(res.start, sizeof(struct mpc83xx_pmc)); + pmc_regs = ioremap(res.start, sizeof(*pmc_regs)); if (!pmc_regs) { ret = -ENOMEM; @@ -374,7 +374,7 @@ static int pmc_probe(struct platform_device *ofdev) goto out_pmc; } - clock_regs = ioremap(res.start, sizeof(struct mpc83xx_pmc)); + clock_regs = ioremap(res.start, sizeof(*clock_regs)); if (!clock_regs) { ret = -ENOMEM;