From owner-svn-src-all@freebsd.org Tue May 10 16:34:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79058B368C6; Tue, 10 May 2016 16:34:08 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (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 426831304; Tue, 10 May 2016 16:34:08 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 4EC0A1FE022; Tue, 10 May 2016 18:34:05 +0200 (CEST) Subject: Re: svn commit: r299363 - head/sys/compat/linuxkpi/common/include/asm To: cem@FreeBSD.org, John Baldwin References: <201605101139.u4ABdaTL098171@repo.freebsd.org> <7693af09-def2-e8a7-b7fd-9b6df41908cc@selasky.org> <4312956.Tckd6PoFKf@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: Date: Tue, 10 May 2016 18:37:22 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 10 May 2016 16:34:08 -0000 On 05/10/16 18:05, Conrad Meyer wrote: > On Tue, May 10, 2016 at 8:55 AM, John Baldwin wrote: >> On Tuesday, May 10, 2016 05:06:08 PM Hans Petter Selasky wrote: >>> On 05/10/16 13:39, Hans Petter Selasky wrote: >>>> Author: hselasky >>>> Date: Tue May 10 11:39:36 2016 >>>> New Revision: 299363 >>>> URL: https://svnweb.freebsd.org/changeset/base/299363 >>>> >>>> Log: >>>> Use function macros when possible to avoid stray substitutions. >>>> >>>> MFC after: 1 week >>>> Sponsored by: Mellanox Technologies >>>> >> >> Is the reason for the change to avoid accepting the wrong number of arguments >> (e.g. cpu_to_be32(x, y))? Won't that still fail to compile if so? (That is, >> the reasoning for why you made the original change isn't clear to me from the >> commit.) > > The macro form also prevents clobbering non-function-pointer variables > named "cpu_to_be32," right? Not that that's a great variable name. > Hi, That's right Conrad. My intention was to avoid substitutions outside the function domain, like in a structure like this for example: struct { int cpu_to_be32; } xxx; These functions only accepts one argument, so no problem there. --HPS