From owner-svn-src-all@FreeBSD.ORG Fri Jun 1 15:22:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C6501106564A; Fri, 1 Jun 2012 15:22:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 980B88FC0A; Fri, 1 Jun 2012 15:22:50 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1481CB94E; Fri, 1 Jun 2012 11:22:50 -0400 (EDT) From: John Baldwin To: Eitan Adler Date: Fri, 1 Jun 2012 10:24:48 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: <201206010423.q514NKtf083043@svn.freebsd.org> <20120601150242.V1226@besplex.bde.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201206011024.49122.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 01 Jun 2012 11:22:50 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r236377 - head/sys/dev/vxge/vxgehal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 15:22:50 -0000 On Friday, June 01, 2012 2:23:42 am Eitan Adler wrote: > On 31 May 2012 22:13, Bruce Evans wrote: > > This seems to change a style by (excessive parentheses for a normal > > equality test) into logic bug (assignment of dtrh instead of compariing > > with it). > > intentional - perhaps my commit message was poorly worded. > > The comment above says > 283 /* > 284 * restore a previously allocated dtrh at current offset and update > 285 * the available reserve length accordingly. If dtrh is null just > 286 * update the reserve length, only > 287 */ > > > and gnn confirmed that the patch as committed is correct. This is why I personally loathe assignment side effects in boolean expressions for control flow. I tend to write this sort of thing instead as: channel->dtr_arr[dtr_index].dtr = dtrh; if (dtrh != NULL) { -- John Baldwin