]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
pwm: tegra: Avoid potential overflow for short periods
authorThierry Reding <thierry.reding@gmail.com>
Wed, 12 Apr 2017 16:29:23 +0000 (18:29 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 13 Apr 2017 15:34:54 +0000 (17:34 +0200)
commit6db78b201b3fa3611b9557f0d677cd4560358f9d
tree6a8601d0f02f647d29193005f8bd715f3c3922f8
parent4a813b262f85ac34c9f3e557d9be79f846a381df
pwm: tegra: Avoid potential overflow for short periods

For very short periods, the result of the division might overflow the
unsigned long hz variable (on 32-bit architectures). Avoid that by
making it an unsigned long long. While at it, also remove an unneeded
local variable whose only purpose is to store a temporary computation.

Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-tegra.c