From owner-svn-src-all@FreeBSD.ORG Thu Sep 4 17:11:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACCFA203; Thu, 4 Sep 2014 17:11:53 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C5F918A9; Thu, 4 Sep 2014 17:11:53 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s84HBqJV099263 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Sep 2014 10:11:52 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s84HBq1W099262; Thu, 4 Sep 2014 10:11:52 -0700 (PDT) (envelope-from jmg) Date: Thu, 4 Sep 2014 10:11:52 -0700 From: John-Mark Gurney To: Gleb Smirnoff Subject: Re: svn commit: r270999 - head/sys/kern Message-ID: <20140904171151.GF82175@funkthat.com> References: <201409030814.s838E7A2084257@svn.freebsd.org> <20140903085523.GB13871@dft-labs.eu> <20140903094916.GO7693@FreeBSD.org> <20140903191028.GG71691@funkthat.com> <20140904091844.GC7693@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140904091844.GC7693@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 04 Sep 2014 10:11:52 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Mateusz Guzik , kib@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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: Thu, 04 Sep 2014 17:11:53 -0000 Gleb Smirnoff wrote this message on Thu, Sep 04, 2014 at 13:18 +0400: > On Wed, Sep 03, 2014 at 12:10:28PM -0700, John-Mark Gurney wrote: > J> > M> > + if (p->p_pptr) { > J> > M> > kp->ki_ppid = proc_realparent(p)->p_pid; > J> > M> > - if (p->p_flag & P_TRACED) > J> > M> > - kp->ki_tracer = p->p_pptr->p_pid; > J> > M> > + if (p->p_flag & P_TRACED) > J> > M> > + kp->ki_tracer = p->p_pptr->p_pid; > J> > M> > + } > J> > M> > } > J> > M> > > J> > M> > /* > J> > M> > > J> > M> > J> > M> p_pptr must be non-NULL if P_TRACED is set. If there is no way to > J> > M> annotate it for coverity, this change deserves a comment in the code > J> > M> (and in retrospect previous code should have had appropriate comment as > J> > M> well). > J> > > J> > Thanks for explanation. > J> > > J> > I'd suggest to leave the change in, since now it is a micro-micro-optimization :) > J> > J> If you must leave it in, then at least compare the pointer against > J> NULL, and collapse two if statements into one... > J> > J> We should never introduce new pointer checks that aren't against NULL... > > I don't see how two if statements can be collapsed? We need to assign > ki_ppid regardless of P_TRACED flag. Sorry, misread the diff, you are correct... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."