Commit c6554045 authored by Dan Carpenter's avatar Dan Carpenter Committed by Michael Ellerman

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: d49747bd ("powerpc/mpc83xx: Power Management support")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
[mpe: It will map at least one page anyway, but still a good cleanup]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent b96672dd
...@@ -361,7 +361,7 @@ static int pmc_probe(struct platform_device *ofdev) ...@@ -361,7 +361,7 @@ static int pmc_probe(struct platform_device *ofdev)
return -EBUSY; return -EBUSY;
} }
pmc_regs = ioremap(res.start, sizeof(struct mpc83xx_pmc)); pmc_regs = ioremap(res.start, sizeof(*pmc_regs));
if (!pmc_regs) { if (!pmc_regs) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -374,7 +374,7 @@ static int pmc_probe(struct platform_device *ofdev) ...@@ -374,7 +374,7 @@ static int pmc_probe(struct platform_device *ofdev)
goto out_pmc; goto out_pmc;
} }
clock_regs = ioremap(res.start, sizeof(struct mpc83xx_pmc)); clock_regs = ioremap(res.start, sizeof(*clock_regs));
if (!clock_regs) { if (!clock_regs) {
ret = -ENOMEM; ret = -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment