mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wen Yang <wenyang@linux.alibaba.com>
To: Justin Capella <justincapella@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	xlpang@linux.alibaba.com, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] ftrace: avoid potential division by zero
Date: Fri, 3 Jan 2020 19:31:49 +0800	[thread overview]
Message-ID: <a2468cc8-cdc1-0a03-6de1-6607bff4d0fa@linux.alibaba.com> (raw)
In-Reply-To: <CAMrEMU8wB4c0TFTSJ4ixQg_gSnW72n_T3ip8ZfZFAk8xWjaKsA@mail.gmail.com>



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

      reply	other threads:[~2020-01-03 11:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-03  3:02 Wen Yang
2020-01-03  8:00 ` Justin Capella
2020-01-03 11:31   ` Wen Yang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a2468cc8-cdc1-0a03-6de1-6607bff4d0fa@linux.alibaba.com \
    --to=wenyang@linux.alibaba.com \
    --cc=justincapella@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=xlpang@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®