From owner-svn-src-head@freebsd.org Thu Sep 28 19:57:48 2017 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 296E6E07ACA; Thu, 28 Sep 2017 19:57:48 +0000 (UTC) (envelope-from n_hibma@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 mx1.freebsd.org (Postfix) with ESMTPS id ED19C6BE6F; Thu, 28 Sep 2017 19:57:47 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8SJvlwS026136; Thu, 28 Sep 2017 19:57:47 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8SJvlDX026135; Thu, 28 Sep 2017 19:57:47 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201709281957.v8SJvlDX026135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Thu, 28 Sep 2017 19:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324089 - head/sys/dev/neta X-SVN-Group: head X-SVN-Commit-Author: n_hibma X-SVN-Commit-Paths: head/sys/dev/neta X-SVN-Commit-Revision: 324089 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.23 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: Thu, 28 Sep 2017 19:57:48 -0000 Author: n_hibma Date: Thu Sep 28 19:57:46 2017 New Revision: 324089 URL: https://svnweb.freebsd.org/changeset/base/324089 Log: Make this compile if NO_SYSCTL_DESCR is defined. Defining a variable with the description and then only use it in the SYSCTL declaration led to an unused variable warning. In the SYSCTL the passed value is discarded using __DESCR. Modified: head/sys/dev/neta/if_mvneta.c Modified: head/sys/dev/neta/if_mvneta.c ============================================================================== --- head/sys/dev/neta/if_mvneta.c Thu Sep 28 19:33:36 2017 (r324088) +++ head/sys/dev/neta/if_mvneta.c Thu Sep 28 19:57:46 2017 (r324089) @@ -3411,6 +3411,7 @@ sysctl_mvneta_init(struct mvneta_softc *sc) }; #undef MVNETA_SYSCTL_NAME +#ifndef NO_SYSCTL_DESCR #define MVNETA_SYSCTL_DESCR(num) "configuration parameters for queue " # num static const char *sysctl_queue_descrs[] = { MVNETA_SYSCTL_DESCR(0), MVNETA_SYSCTL_DESCR(1), @@ -3419,6 +3420,7 @@ sysctl_mvneta_init(struct mvneta_softc *sc) MVNETA_SYSCTL_DESCR(6), MVNETA_SYSCTL_DESCR(7), }; #undef MVNETA_SYSCTL_DESCR +#endif ctx = device_get_sysctl_ctx(sc->dev); @@ -3442,15 +3444,14 @@ sysctl_mvneta_init(struct mvneta_softc *sc) */ /* dev.mvneta.[unit].mib. */ for (i = 0; i < MVNETA_PORTMIB_NOCOUNTER; i++) { - const char *name = mvneta_mib_list[i].sysctl_name; - const char *desc = mvneta_mib_list[i].desc; struct mvneta_sysctl_mib *mib_arg = &sc->sysctl_mib[i]; mib_arg->sc = sc; mib_arg->index = i; - SYSCTL_ADD_PROC(ctx, mchildren, OID_AUTO, name, + SYSCTL_ADD_PROC(ctx, mchildren, OID_AUTO, + mvneta_mib_list[i].sysctl_name, CTLTYPE_U64|CTLFLAG_RD, (void *)mib_arg, 0, - sysctl_read_mib, "I", desc); + sysctl_read_mib, "I", mvneta_mib_list[i].desc); } SYSCTL_ADD_UQUAD(ctx, mchildren, OID_AUTO, "rx_discard", CTLFLAG_RD, &sc->counter_pdfc, "Port Rx Discard Frame Counter");