lkml.org 
[lkml]   [2020]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] ftrace: avoid potential division by zero
From
Date


On 2020/1/3 4:00 下午, Justin Capella wrote:
>> - do_div(stddev, rec->counter * (rec->counter - 1) * 1000);
>>
>> + stddev = div64_ul(stddev,
>> + rec->counter * (rec->counter - 1) * 1000);
>
>
> Is a rec->counter > 1 assertion needed here?
>

Hello, the above lines deal with this situation:

if (rec->counter <= 1)
stddev = 0;
else {


--
Regards,
Wen

\
 
 \ /
  Last update: 2020-01-03 12:32    [W:0.056 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site