From owner-svn-src-head@freebsd.org Sat Mar 3 20:54:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64833F3B87A for ; Sat, 3 Mar 2018 20:54:40 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7D3576050 for ; Sat, 3 Mar 2018 20:54:39 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 04b4a8d0-1f25-11e8-bb8e-b35b57339d60 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 04b4a8d0-1f25-11e8-bb8e-b35b57339d60; Sat, 03 Mar 2018 20:54:09 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w23KsWjE091047; Sat, 3 Mar 2018 13:54:32 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1520110472.23690.18.camel@freebsd.org> Subject: Re: svn commit: r330352 - in head/sys/compat/linuxkpi/common: include/linux src From: Ian Lepore To: Konstantin Belousov Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 03 Mar 2018 13:54:32 -0700 In-Reply-To: <20180303204913.GI3194@kib.kiev.ua> References: <201803031854.w23IsHxm086835@repo.freebsd.org> <1520104482.23690.15.camel@freebsd.org> <20180303204913.GI3194@kib.kiev.ua> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 20:54:40 -0000 On Sat, 2018-03-03 at 22:49 +0200, Konstantin Belousov wrote: > On Sat, Mar 03, 2018 at 12:14:42PM -0700, Ian Lepore wrote: > > > > To really avoid roundoff errors, use mstosbt(ms) instead of SBT_1MS*ms. > > > > The rounding errors when multiplying or dividing by SBT_1MS is not > > severe like it is with SBT_1NS, but the inline functions still do the > > arithmetic more correctly to avoid roundoff error. > BTW mstosbt() and other functions have weird bracing in the formula. I > think that the formula as calculated by the C operator precedence is > fine, i.e. multiplication is done before right shift. But the bracing > is redundand then, because the '()' pair next to the return () braces by > inclusion is tautological. Yeah, I noticed earlier today there is an extra set of parens.  I think I might have copied the code from being a multi-line expression to being all in the return and just pasted it without removing the extra parens. In general, I prefer extra parens instead of relying on knowledge of operator precedence, but it makes no sense for the outermost layer of parens. -- Ian