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.
This commit is contained in:
parent
eb847626a3
commit
3bc4bd5edd
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user