From owner-svn-src-all@freebsd.org Tue Mar 15 07:40:53 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 1B984AD111C; Tue, 15 Mar 2016 07:40:53 +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 DA69A88; Tue, 15 Mar 2016 07:40:52 +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 0A7D01FE024; Tue, 15 Mar 2016 08:40:50 +0100 (CET) Subject: Re: svn commit: r296868 - head/sys/sys To: Gleb Smirnoff , Ryan Stone References: <201603141807.u2EI7xqm075602@repo.freebsd.org> <20160314203318.GL1328@FreeBSD.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: <56E7BD28.2000606@selasky.org> Date: Tue, 15 Mar 2016 08:43:36 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160314203318.GL1328@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 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, 15 Mar 2016 07:40:53 -0000 On 03/14/16 21:33, Gleb Smirnoff wrote: > On Mon, Mar 14, 2016 at 02:31:37PM -0400, Ryan Stone wrote: > R> On Mon, Mar 14, 2016 at 2:07 PM, Gleb Smirnoff wrote: > R> > R> > Remove useless cast in SYSCTL_ADD_COUNTER_U64 macro. > R> > > R> > R> Is it useless? I believe that the point is to give a compiler error if an > R> incompatible pointer type was passed as the ptr parameter. > > Thanks for explanation! I will back out. > Hi, I added the casts to get more checks with regard to the type safety in the sysctls, because sysctl_add_oid() uses "void *". They are not useless. Maybe this should be explained in a comment somewhere? Similarly you'll find a set of sizeof() compile time assert checks for the static sysctls. --HPS