Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Sep 2017 19:57:47 +0000 (UTC)
From:      Nick Hibma <n_hibma@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r324089 - head/sys/dev/neta
Message-ID:  <201709281957.v8SJvlDX026135@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.<mibs> */
 	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");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709281957.v8SJvlDX026135>