From 0dd9b7dc5f75d803e3f685c36e107769377c7ffe Mon Sep 17 00:00:00 2001 From: xtraeme Date: Tue, 11 Sep 2007 07:36:22 +0000 Subject: [PATCH] Cosmetic: use the last enum member for max sensors number. --- sys/lkm/misc/envsys2/lkminit_envsys2.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sys/lkm/misc/envsys2/lkminit_envsys2.c b/sys/lkm/misc/envsys2/lkminit_envsys2.c index 6cb22b825a3e..177d1adf7e57 100644 --- a/sys/lkm/misc/envsys2/lkminit_envsys2.c +++ b/sys/lkm/misc/envsys2/lkminit_envsys2.c @@ -1,4 +1,4 @@ -/* $NetBSD: lkminit_envsys2.c,v 1.6 2007/09/09 16:09:37 xtraeme Exp $ */ +/* $NetBSD: lkminit_envsys2.c,v 1.7 2007/09/11 07:36:22 xtraeme Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lkminit_envsys2.c,v 1.6 2007/09/09 16:09:37 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lkminit_envsys2.c,v 1.7 2007/09/11 07:36:22 xtraeme Exp $"); #include #include @@ -50,8 +50,6 @@ __KERNEL_RCSID(0, "$NetBSD: lkminit_envsys2.c,v 1.6 2007/09/09 16:09:37 xtraeme #include #include -#define MAXSENSORS 18 - /* * The list of sensors. */ @@ -74,12 +72,13 @@ enum sensors { SENSOR_DUP_CPUTEMP, SENSOR_DUP_TECHNOLOGY, SENSOR_EMPTY_DESC, - SENSOR_INVALID_STATE + SENSOR_INVALID_STATE, + SENSOR_MAXSENSORS /* must be last */ }; struct envsys2_softc { struct sysmon_envsys sc_sysmon; - envsys_data_t sc_sensor[MAXSENSORS]; + envsys_data_t sc_sensor[SENSOR_MAXSENSORS]; }; /* @@ -344,7 +343,7 @@ envsys2_mod_handle(struct lkm_table *lkmtp, int cmd) sc->sc_sysmon.sme_sensor_data = sc->sc_sensor; sc->sc_sysmon.sme_cookie = sc; sc->sc_sysmon.sme_gtredata = envsys2_gtredata; - sc->sc_sysmon.sme_nsensors = MAXSENSORS; + sc->sc_sysmon.sme_nsensors = SENSOR_MAXSENSORS; err = sysmon_envsys_register(&sc->sc_sysmon); if (err)