Messages in this thread | | | Subject | Re: [PATCH v2] ftrace: avoid potential division by zero | From | Wen Yang <> | Date | Fri, 3 Jan 2020 19:31:49 +0800 |
| |
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
| |