powerpc/eeh: Reduce to one the number of places where edev is allocated
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Tue, 29 Aug 2017 07:34:00 +0000 (17:34 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 31 Aug 2017 04:26:08 +0000 (14:26 +1000)
commit8bae6a23198defc5576e4c6f1f97822883d705ae
tree83e2a6c9a7734b64fa6d3bbae2207296695483ee
parent5f600b17d190aa0e4011557fd6abb05908a53a0d
powerpc/eeh: Reduce to one the number of places where edev is allocated

arch/powerpc/kernel/eeh_dev.c:57 is the only legit place where edev
is allocated; other 2 places allocate it on stack and in the heap for
a very short period of time to use eeh_pe_get() as takes edev.

This changes eeh_pe_get() to receive required parameters explicitly.

This removes unnecessary temporary allocation of edev.

This uses the "pe_no" name instead of the "pe_config_addr" name as
it actually is a PE number and not a config space address as it seemed.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/eeh.h
arch/powerpc/kernel/eeh_pe.c
arch/powerpc/platforms/powernv/eeh-powernv.c