From nobody Wed Apr 13 23:10:11 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 00D7A1B42524; Wed, 13 Apr 2022 23:10:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kdyx048zRz4mSj; Wed, 13 Apr 2022 23:10:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649891412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LlLILNuqkxCo8jZms3zAbqTcFrvaoVm/84CNrG5wpM8=; b=X7H78/YFx8y57CG9EsQpgVmd9/cwytbKFsm5u+Q/PJK/d8EzgyY+RsjeaoznFyO6e8ZNcv 20t+PW+rW23VZbF2SPPUaz05o+5a35rT+26NZjaC314ElTtxNHqMyI7zdGEh+91lqqsK2J 59NbyQAAlXz+In1jJzyYtcE9XPHQSwhlWBUL1owaXcMYL/6k6lBIZxsy94ogBHAjqojqzd IGGkc5XMoEhXJDcDvD+m/Vq5/Yn1LdmyLt2m4k2UgeQylrjn4ooN/q8JSq1rURszYCyCsH jbgBejo5CLp2UUfF0eFL3ebOeRKU0UZdEl9hlorUlD33mjFnRYjvK4ZHu3o74Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 101961540A; Wed, 13 Apr 2022 23:10:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23DNABSA079119; Wed, 13 Apr 2022 23:10:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23DNABW2079116; Wed, 13 Apr 2022 23:10:11 GMT (envelope-from git) Date: Wed, 13 Apr 2022 23:10:11 GMT Message-Id: <202204132310.23DNABW2079116@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: dd636cb9d04e - main - ad7417: Avoid an unused but set warning when compiled with NO_SYSCTL_DESCR. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd636cb9d04eb075c8425b9f825ca6ac29b9e01d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649891412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LlLILNuqkxCo8jZms3zAbqTcFrvaoVm/84CNrG5wpM8=; b=cvd57V/MAXbM7lCciF1IEZgfQGVJw6uWdJ6PG3vRiuWJa5uxVUOVTSolTEgXGJ2Fs8DGJn 4J53/L6TZ1m+AGWKNVk/k6zIDJQsfPAdIM1f+tgQJRsOV+g3BCWUrMpno7bVx7fKBAnLZM v2W29iHqK5f8QpRHlTccfyrANZSbk9Fo40WBtW2aOZz0ewCOp/fmNwJwiywFdzlYEI8VWq TYxIYJR9LJP7CQow76+vR5F2j230ctGOkkjld3FlFMr2FW/X4pNzyAXGPq7+rbohMl9J7P lqJgUNCePtPa22NGI7jwy0AcdEnMAGAnXQEmpKFpMv/ngJr3gOS4dMyyRXBn7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649891412; a=rsa-sha256; cv=none; b=vx40W5EPl+6W+Lbasm8J5tZUQEgSBmLhhS6IIwc+PVTM2lmJAXDfzInoIoY1EAz3ZtxiDJ mm47Kpjjm4sG4QcIou8yfiqmWGK5GXR17QuuTp6qK7VU48XaDnnaj7Z1E3VCdmyx/BlLmJ rUqy9fptwaNlkujPZOOUI3KITyl1xRZyVLv7MxMgfxWw5xXXE8rsNarkOwCYlTt8uXqkqG 3zDvUFvNX0SHbgX8DEoeMAruAwWaXh5GbCnKfjvCcRQ5JukIG0GWRUX7DgrBfcgk5a5+Ze MXWsuYAWNFlEw1xDpzsjIEVYzjUmKr+CHG5BV60mNxk6EhFQslg0bN9gLpubug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=dd636cb9d04eb075c8425b9f825ca6ac29b9e01d commit dd636cb9d04eb075c8425b9f825ca6ac29b9e01d Author: John Baldwin AuthorDate: 2022-04-13 23:08:23 +0000 Commit: John Baldwin CommitDate: 2022-04-13 23:08:23 +0000 ad7417: Avoid an unused but set warning when compiled with NO_SYSCTL_DESCR. Use a ternary operator for the description string passed to SYSCTL_ADD_PROC instead of a helper variable. --- sys/dev/iicbus/ad7417.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/dev/iicbus/ad7417.c b/sys/dev/iicbus/ad7417.c index 43170ce2e81f..6e110d698a4d 100644 --- a/sys/dev/iicbus/ad7417.c +++ b/sys/dev/iicbus/ad7417.c @@ -409,7 +409,6 @@ ad7417_attach(device_t dev) char sysctl_name[32]; int i, j; const char *unit; - const char *desc; sc = device_get_softc(dev); @@ -450,17 +449,17 @@ ad7417_attach(device_t dev) if (sc->sc_sensors[i].type == ADC7417_TEMP_SENSOR) { unit = "temp"; - desc = "sensor unit (C)"; } else { unit = "volt"; - desc = "sensor unit (mV)"; } /* I use i to pass the sensor id. */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, unit, CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, i, ad7417_sensor_sysctl, sc->sc_sensors[i].type == ADC7417_TEMP_SENSOR ? - "IK" : "I", desc); + "IK" : "I", + sc->sc_sensors[i].type == ADC7417_TEMP_SENSOR ? + "sensor unit (C)" : "sensor unit (mV)"); } /* Dump sensor location, ID & type. */ if (bootverbose) {