From owner-svn-src-head@freebsd.org Wed Jan 15 16:20:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D67E1F7196; Wed, 15 Jan 2020 16:20:47 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 47yXcZ5sJqz4g8L; Wed, 15 Jan 2020 16:20:46 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00FGKhxK093228 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 15 Jan 2020 08:20:43 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00FGKhf5093227; Wed, 15 Jan 2020 08:20:43 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Wed, 15 Jan 2020 08:20:43 -0800 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, bz@freebsd.org, cem@freebsd.org Subject: Re: svn commit: r356755 - in head/sys: net netinet netinet6 netpfil/ipfw/nat64 sys Message-ID: <20200115162043.GS39529@FreeBSD.org> References: <202001150605.00F65Kc8011526@repo.freebsd.org> <20200115061046.GR39529@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 47yXcZ5sJqz4g8L X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-0.21 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_MEDIUM(0.66)[0.663,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; NEURAL_HAM_LONG(-0.87)[-0.872,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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: Wed, 15 Jan 2020 16:20:47 -0000 On Wed, Jan 15, 2020 at 09:51:02AM +0100, Hans Petter Selasky wrote: H> On 2020-01-15 07:10, Gleb Smirnoff wrote: H> > I really want to reverse the argument order of epoch_call() as well. H> > The current order is really backwards: H> > H> > void H> > epoch_call(epoch_t epoch, epoch_context_t ctx, H> > void (*callback)(epoch_context_t)); H> > H> > Suggested declaration is: H> > H> > void H> > epoch_call(epoch_t epoch, epoch_context_t ctx, H> > void (*callback)(epoch_context_t)); H> H> I think he meant to put the ctx argument last. Look at how the function H> is implemented to see if that makes any sense, I.E. how arguments are H> optimised. Yes, of course. I had too little tea last night and didn't swap arguments after copy-n-paste. Suggested prototype is: void epoch_call(epoch_t epoch, void (*callback)(epoch_context_t), epoch_context_t ctx); H> Is this *want* just because of "function, argument" is better than H> "argument, function" ? Sure. There is no practical impact on how a CPU will execute. It is all about how a human reads a code. -- Gleb Smirnoff