From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 09:18:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA19FFCA; Thu, 4 Sep 2014 09:18:48 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 58A301A69; Thu, 4 Sep 2014 09:18:47 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s849IiGC011171 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 4 Sep 2014 13:18:44 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s849IiCh011170; Thu, 4 Sep 2014 13:18:44 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 4 Sep 2014 13:18:44 +0400 From: Gleb Smirnoff To: John-Mark Gurney Subject: Re: svn commit: r270999 - head/sys/kern Message-ID: <20140904091844.GC7693@FreeBSD.org> References: <201409030814.s838E7A2084257@svn.freebsd.org> <20140903085523.GB13871@dft-labs.eu> <20140903094916.GO7693@FreeBSD.org> <20140903191028.GG71691@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140903191028.GG71691@funkthat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Mateusz Guzik , kib@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 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: Thu, 04 Sep 2014 09:18:49 -0000 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. -- Totus tuus, Glebius.