]> git.baikalelectronics.ru Git - kernel.git/commit
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>
Tue, 18 Aug 2020 22:01:21 +0000 (18:01 -0400)
commit38b1f54f9c3821f41c50142ccf83bfdb47b130a0
tree848e6e3b5e1c708c555ad9aca80db30034f760db
parentd99e5a113fcfe7f805f6ee6dac5d4d9cce629dde
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