On 06/25/2020 02:34 PM, Yoshihiro Shimoda wrote: >>> From: Dien Pham <dien.pham.ry@xxxxxxxxxxx> >>> >>> As description for DIV_ROUND_CLOSEST in file include/linux/kernel.h. >>> "Result is undefined for negative divisors if the dividend variable >>> type is unsigned and for negative dividends if the divisor variable >>> type is unsigned." >>> >>> In current code, the FIXPT_DIV uses DIV_ROUND_CLOSEST but has not >>> checked sign of divisor before using. It makes undefined temperature >>> value in case the value is negative. >>> >>> This patch fixes to satisfy DIV_ROUND_CLOSEST description >>> and fix bug too. Note that the variable name "reg" is not good >>> because it should be the same type as rcar_gen3_thermal_read(). >>> However, there is better to rename it in a further patch as >> >> It's better. > > Thank you for your review! I'll fix it. Note that "there" isn't needed there, I wasn't explicit enough, it seems... > Best regards, > Yoshihiro Shimoda MBR, Sergei