From owner-svn-src-head@freebsd.org Wed Apr 20 15:58:48 2016 Return-Path: Delivered-To: svn-src-head@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 723F9B15B5C for ; Wed, 20 Apr 2016 15:58:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm7.bullet.mail.bf1.yahoo.com (nm7.bullet.mail.bf1.yahoo.com [98.139.212.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 272E6108F for ; Wed, 20 Apr 2016 15:58:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461167925; bh=FOGUC6KN5n6PB+ZFOyIhLvSq2GpMK5BFFP1fTsFmCzQ=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=HLahhZCDF+s5JvXAFyJ4phBuBt+fI3ossCa+qXPTGIYcq/+7MAsqI6U1K5Gp/EmbNkNnaw93dv8wv20QEoYtQV53c5aMjfHMaX7qolpwDmmBeTNR8xR1njDsd0eypoCmv8+VX6Sk+lvKw9NovNNNKdkhtPBDQasfdeAYsPdKWuN54c6BMkky4x4i6Ldnl6A4oqQGdkw5MUdRS13onMRy2fNtQO472QuvoN4ur2Hk3gdJsW+FAMkDdnkGxAGTsZ9cwHKv8UP9ezXyAz8leahiOCWRan4uJXZKwFTLbB1C2bUevNBRgeRic6ZalSIhoRprXpdjrO8r/Vbdto2srr4Yow== Received: from [98.139.170.178] by nm7.bullet.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 15:58:45 -0000 Received: from [98.139.211.203] by tm21.bullet.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 15:58:45 -0000 Received: from [127.0.0.1] by smtp212.mail.bf1.yahoo.com with NNFMP; 20 Apr 2016 15:58:45 -0000 X-Yahoo-Newman-Id: 99920.90198.bm@smtp212.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: tmyM5AUVM1lmpF9d_WAsBWyMQYdBndipb6q3jAM.mUMIsJ1 pMKWrHigiVr2umHf1nfZ1WEm2KmONRErzEWmFEmQ2tfscTj0p6symYh0.Koo ._qFwLIBvJ3G9oUcVehxbdpYJD_LbwgRlsnSF7adrx5NYpNsrdGrl_E0nauI ScxHkVtFuG82fBsrHi4i.bpOM.k_8tUxdWuqH.gpuI2pf8WROK4QThzz0_jM Dkkhlo0IIkZXKhfV2JQ8n1vjPB_IetHiQq0NK_vPqfDqrWOgeFMGx6nxoG78 GcXuCFROS_mS_A52dG_oacvsBgLR_iag6FyUS451tLmge6pdCiIkCE6UJyXt t_W85afZB.Jk1dlTZioedZsW7IDA3e.ylUiI.JIqyahGisgP8gJjETMBwz09 SrddA492QqbLIK4p2C409cJ1fHoEe9KpyjGYfAtlM8D80J4VpKVVyfwRyS1. iso40j0u2mkESJl0nW0XvLOIyHwtxmXsQPvLndeW7sWax0yJCnyr.AtZmRzN 2IFsm8Y.a7mBvOExK0BDb2tM8yRdvU_p6 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298247 - head/sbin/fdisk_pc98 To: Bruce Evans , Conrad Meyer References: <201604190446.u3J4kD9G050780@repo.freebsd.org> <4114217.PtcV9LDMal@ralph.baldwin.cx> <20160420115844.Y967@besplex.bde.org> <20160421004457.L1073@besplex.bde.org> Cc: araujo@freebsd.org, John Baldwin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: Date: Wed, 20 Apr 2016 10:58:48 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160421004457.L1073@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 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, 20 Apr 2016 15:58:48 -0000 On 04/20/16 10:15, Bruce Evans wrote: > On Wed, 20 Apr 2016, Conrad Meyer wrote: > >> On Wed, Apr 20, 2016 at 7:33 AM, Pedro Giffuni wrote: >>> One of the things I dislike is that most of the macros are in >>> lowercase. Lowercase would make sense if these were inline functions >>> but inline functions have disadvantages for these use cases. >>> OTOH, if they were uppercase, they would not be very easy on the eyes, >>> which is the current advantage. > > Lower case is correct if nitems is a safe macro. I think it is safe, > because its parameter must be an array and an expression with side > effects can't be an array. > Ahh .. so I guess it's not that bad then :-/. >> You bring up a good point. Obviously nitems() can't be an inline >> function, but roundup2() and friends could. Is there any reason not >> to change them over to inline functions? > > 1. Namespace pollution. Adding nitems() to sys/param.h already broke > anything using that name. > Yes, and there's nothing to do now. > 2. roundup2() and friends can't be inline functions without unportable > complications to make them type-generic. No one ever did this for > the more important imin() family of inline functions. 4.4BSD removed > the MAX() and MIN() macros in the kernel to enforce use of the imin() > family, but this gave type errors and was routed around by restoring > the macros, first in scattered places and then back in sys/param.h. > I see, the imin() stuff is in sys/libkern.h. Looks like a nice use case for coccinelle. Pedro.