Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18343921ybl; Fri, 3 Jan 2020 00:01:41 -0800 (PST) X-Google-Smtp-Source: APXvYqzP3tgspNezccszxWorkFMdcWvYSfz7loqhZP0pBBPoU6bYUSctjfZxk+ORi2vB2fA7AgFo X-Received: by 2002:a9d:478:: with SMTP id 111mr95556409otc.359.1578038501529; Fri, 03 Jan 2020 00:01:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578038501; cv=none; d=google.com; s=arc-20160816; b=kU/KkVajGus1rbCn5YaIs1wkxCUts2ivH6DSmVQYlwI0QHQ+7SLNFSeLuCJPRksuaC 7d2RJWrOhabdV6rGS8tl19bnBFKFhifQYvSrhe6eiPGbrpW2WbE71iBZnImHvB9JrhmH w6rzWgcFbQgbsTC23OwhJcoKdwe8GwQ/PownfZ6gPgYcRjK84U6G7PgMcWESq6DPfPLG wKSR5fCEkDzidjeWe0Miv9Ya1pdMGoSKB8FE/AbMURiCL7Zzae2oHbER9vSEvZA+a66N DZUXCsw2U4SswNq+hHfxRaKJrw2MlhT70O9EbByWRpoitaznJXoud31pWkXiytAdBk8C p1ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NxA2yBNeWlIfszkTmeiVyLhyQ77gT+nUBeVRVNBKmek=; b=BaOrKdCHy9OdnKmdphDil910yFKyfsVSd1A3+5fZCVGmDj29mFi6A4xxnCPjznB47t LQQrjIj50sM8s2KTj6fes90TePzJNTqV/50GyieCcmr3hdCM8MFL2S5L67HZ4vPzzWa1 BfN9LviQ/1ec/cGMWjV/262wjLjXF/b3VZP+Se9jD3dj0CGw5Ae4IuMFJd3ZRFZ1Ut08 InxjT+6pA7vKsmcTBDYNbx8Kc/Br6KhOJbWr52kBMx5NwLsgP++zVYyeJgfeZ3efUWeU KoD4SZngOBzgTzCY90tcS+dWb7jTYYJgfT3EMAhkll84qkJk6nTFW9Pt9XQNq4AigS5n 32Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BVw2XaEu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si30632506otb.49.2020.01.03.00.01.29; Fri, 03 Jan 2020 00:01:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BVw2XaEu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726313AbgACIAg (ORCPT + 99 others); Fri, 3 Jan 2020 03:00:36 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:33771 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbgACIAf (ORCPT ); Fri, 3 Jan 2020 03:00:35 -0500 Received: by mail-ot1-f65.google.com with SMTP id b18so38352022otp.0 for ; Fri, 03 Jan 2020 00:00:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NxA2yBNeWlIfszkTmeiVyLhyQ77gT+nUBeVRVNBKmek=; b=BVw2XaEu0R7rg3maZaoUSFcqIbOaLflaNcJ+ucJBxRPEGNYHx98DacR+6GlgV1Fzqd j2XZDX2H+fEOdpmEAv+kiU+mINa5K1clT9ttqyTb97+zzycg/T0mIPIlRSFikpEVuclo GWMCQXplQfXHhYjMz576QTAWkN43Y3xfO26p+RB4njfgl/qlM3mMFhpO7pyWIjy2AyxH TiebLUAqMmlxS4kRx+ArRdkoddQlOk/XUPAHvAgJJigVJZP1aY2iEB92XXQ1OIXl0gOD lCTmOciPXUkO9xBStiQ0YBnTRg1uBAjpR4bZrOZ0rIfyzQtCDgJDy2hhhOGGoSq/haXy r+gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NxA2yBNeWlIfszkTmeiVyLhyQ77gT+nUBeVRVNBKmek=; b=fV3JjG2/aRsgDntAXxo8qrqKMJxsl4FLx33nFXVLcZgkN2G33njqxSa9Njxdzqd42y 0+WYi+SWLjEhsoxt5VAES1++dapEItcLwLKX3wIUZCKnKg83aJEz+zKRnfRO3t3Jjc6f 23j71EtHEXKAMh3OJR6pcxgbXRDiRDIUsuIWQAtBP/uGR6fx6XM2ukktU0AnkpMUoDLY hh0rrQAsCoZMdvxnGsFIE7VY41RuZLCUx1Rk7ACNOTqJ8pEy8Pw3d7pxCaToduxul6Rd JC0N1f+uk0PrHtEct0OQUtSU/UAipfgkWtcbylitXzNSXcdRj+PZbR/5/zP/i9HxIn+T YPEw== X-Gm-Message-State: APjAAAXHWdTMlpYOUGw5DUXah13yTG1oPshtyI9QSsBXxH2rvaWNBgQM YQ8q2Dp0nNIcm1y87Z0AeYjfbGKw9IOnGQp8BvWh6VAhrSqbQQ== X-Received: by 2002:a05:6830:159a:: with SMTP id i26mr98432619otr.3.1578038435305; Fri, 03 Jan 2020 00:00:35 -0800 (PST) MIME-Version: 1.0 References: <20200103030248.14516-1-wenyang@linux.alibaba.com> In-Reply-To: <20200103030248.14516-1-wenyang@linux.alibaba.com> From: Justin Capella Date: Fri, 3 Jan 2020 00:00:23 -0800 Message-ID: Subject: Re: [PATCH v2] ftrace: avoid potential division by zero To: Wen Yang Cc: Steven Rostedt , Ingo Molnar , xlpang@linux.alibaba.com, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > - 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?