From owner-svn-src-head@freebsd.org Fri Jun 15 17:29:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D85F1015450; Fri, 15 Jun 2018 17:29:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2164279C79; Fri, 15 Jun 2018 17:29:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 035141A71C; Fri, 15 Jun 2018 17:29:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5FHTWp0042872; Fri, 15 Jun 2018 17:29:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5FHTWUA042871; Fri, 15 Jun 2018 17:29:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806151729.w5FHTWUA042871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 15 Jun 2018 17:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335220 - head/sys/dev/extres/regulator X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/extres/regulator X-SVN-Commit-Revision: 335220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 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: Fri, 15 Jun 2018 17:29:33 -0000 Author: kevans Date: Fri Jun 15 17:29:32 2018 New Revision: 335220 URL: https://svnweb.freebsd.org/changeset/base/335220 Log: extres/regulator: Switch boot_on/always_on sysctl to uint8 These are represented as booleans on the kernel-side, but were being exposed as int. This was causing some funky things to happen when read later with sysctl(8), e.g. randomly reading super-high when the value was actually '0'/false. Reviewed by: manu Modified: head/sys/dev/extres/regulator/regulator.c Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Fri Jun 15 17:16:27 2018 (r335219) +++ head/sys/dev/extres/regulator/regulator.c Fri Jun 15 17:29:32 2018 (r335220) @@ -379,15 +379,15 @@ regnode_create(device_t pdev, regnode_class_t regnode_ OID_AUTO, "enable_cnt", CTLFLAG_RD, ®node->enable_cnt, 0, "The regulator enable counter"); - SYSCTL_ADD_INT(®node->sysctl_ctx, + SYSCTL_ADD_U8(®node->sysctl_ctx, SYSCTL_CHILDREN(regnode_oid), OID_AUTO, "boot_on", - CTLFLAG_RD, (int *) ®node->std_param.boot_on, 0, + CTLFLAG_RD, (uint8_t *) ®node->std_param.boot_on, 0, "Is enabled on boot"); - SYSCTL_ADD_INT(®node->sysctl_ctx, + SYSCTL_ADD_U8(®node->sysctl_ctx, SYSCTL_CHILDREN(regnode_oid), OID_AUTO, "always_on", - CTLFLAG_RD, (int *)®node->std_param.always_on, 0, + CTLFLAG_RD, (uint8_t *)®node->std_param.always_on, 0, "Is always enabled"); SYSCTL_ADD_PROC(®node->sysctl_ctx,