From owner-svn-src-all@FreeBSD.ORG Fri Jan 14 05:56:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B4CC106566B; Fri, 14 Jan 2011 05:56:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 34B6B8FC12; Fri, 14 Jan 2011 05:56:46 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0E5uivs018068 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 14 Jan 2011 16:56:45 +1100 Date: Fri, 14 Jan 2011 16:56:44 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Matthew D Fleming In-Reply-To: <201101131820.p0DIKXip059402@svn.freebsd.org> Message-ID: <20110114162142.M27877@besplex.bde.org> References: <201101131820.p0DIKXip059402@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217369 - in head/sys: cam/scsi sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 14 Jan 2011 05:56:47 -0000 On Thu, 13 Jan 2011, Matthew D Fleming wrote: > Log: > Add a 64-bit hex-printed sysctl(9) since there is at least one place in > the code that wanted it. It is named X64 rather than XQUAD since the > quad name is a historical abomination that should not be perpetuated. :-). It is only long long that is abominable. Both are historical. I think these X formats shouldn't exist, even as defaults. Instead, sysctl(8) should have option(s) to control the format. I'm used to typing lots of "p/x"s to get hex formatting in gdb. There is little reason for sysctl(8) to have finer-grained control than gdb (sysctl now has hard-coded defaults instead of control). Now with stricter type checking, even formats for integers are redundant. The CTLTYPE now always matches the type, and the format should always match the type. The space wasted for the format is 1 pointer plus the string. Perhaps there are some remaining type errors involving the kernel type being signed when it should be unsigned, or vice versa. This could be "fixed" by mis-specifying the format with a U, or vice versa. Since the specification is usually done by invoking a SYSCTL*() macro, most such fixes, if any, would have been undone by changing the macro to match the type, and it would take fixing the kernel type to fix the userland format. > Modified: head/sys/cam/scsi/scsi_da.c > ============================================================================== > --- head/sys/cam/scsi/scsi_da.c Thu Jan 13 18:20:27 2011 (r217368) > +++ head/sys/cam/scsi/scsi_da.c Thu Jan 13 18:20:33 2011 (r217369) > @@ -1127,9 +1127,9 @@ dasysctlinit(void *context, int pending) > struct ccb_trans_settings_fc *fc = &cts.xport_specific.fc; > if (fc->valid & CTS_FC_VALID_WWPN) { > softc->wwpn = fc->wwpn; > - SYSCTL_ADD_XLONG(&softc->sysctl_ctx, > + SYSCTL_ADD_X64(&softc->sysctl_ctx, > SYSCTL_CHILDREN(softc->sysctl_tree), > - OID_AUTO, "wwpn", CTLTYPE_QUAD | CTLFLAG_RD, > + OID_AUTO, "wwpn", CTLFLAG_RD, > &softc->wwpn, "World Wide Port Name"); > } > } > Hmm, forcing hex might be best for flags (but I'll ask for binary then :-) and for mac addresses, but not for inet4 addresses. I don't know what sort of address this is. Bruce