drm/amd/display: fix pow() crashing when given base 0
authorKrunoslav Kovac <Krunoslav.Kovac@amd.com>
Thu, 6 Aug 2020 21:54:47 +0000 (17:54 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 17 Aug 2020 18:08:59 +0000 (14:08 -0400)
commit5ab7943187f22b572fd12d517bd699771b88ce91
tree5b5feac009fb01c20a5baf08ef59f994ce5a5176
parent8cfc40cd97475fcddb2ca4671eaea2eb26b31e0a
drm/amd/display: fix pow() crashing when given base 0

[Why&How]
pow(a,x) is implemented as exp(x*log(a)). log(0) will crash.
So return 0^x = 0, unless x=0, convention seems to be 0^0 = 1.

Cc: stable@vger.kernel.org
Signed-off-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/include/fixed31_32.h