This constifies the tables of two unrelated sensor drivers:
esm(4/i386) and it(4).

ok?

diff d6a09d27ff49886a6b6f4bd1f7d89c0f90a64b40 refs/heads/const
blob - 0a734dc971d9402e738d08d014555c8afb95827b
blob + e8a4e5eeadcdcfd23c1dd525470e70522272676b
--- sys/arch/i386/i386/esm.c
+++ sys/arch/i386/i386/esm.c
@@ -68,7 +68,7 @@ enum esm_sensor_type {
  * map esm sensor types to kernel sensor types.
  * keep this in sync with the esm_sensor_type enum above.
  */
-enum sensor_type esm_typemap[] = {
+const enum sensor_type esm_typemap[] = {
        SENSOR_INTEGER,
        SENSOR_INDICATOR,
        SENSOR_TEMP,
@@ -149,7 +149,7 @@ void                esm_refresh(void *);
 int            esm_get_devmap(struct esm_softc *, int, struct esm_devmap *);
 void           esm_devmap(struct esm_softc *, struct esm_devmap *);
 void           esm_make_sensors(struct esm_softc *, struct esm_devmap *,
-                   struct esm_sensor_map *, int);
+                   const struct esm_sensor_map *, int);
 int            esm_thresholds(struct esm_softc *, struct esm_devmap *,
                    struct esm_sensor *);
 
@@ -536,7 +536,7 @@ esm_get_devmap(struct esm_softc *sc, int dev, struct e
        return (0);
 }
 
-struct esm_sensor_map esm_sensors_esm2[] = {
+const struct esm_sensor_map esm_sensors_esm2[] = {
        { ESM_S_UNKNOWN,        0,              "Motherboard" },
        { ESM_S_TEMP,           0,              "CPU 1" },
        { ESM_S_TEMP,           0,              "CPU 2" },
@@ -604,7 +604,7 @@ struct esm_sensor_map esm_sensors_esm2[] = {
        { ESM_S_UNKNOWN,        0,              "PS Over Temp" }
 };
 
-struct esm_sensor_map esm_sensors_backplane[] = {
+const struct esm_sensor_map esm_sensors_backplane[] = {
        { ESM_S_UNKNOWN,        0,              "Backplane" },
        { ESM_S_UNKNOWN,        0,              "Backplane Control" },
        { ESM_S_TEMP,           0,              "Backplane Top" },
@@ -639,7 +639,7 @@ struct esm_sensor_map esm_sensors_backplane[] = {
        { ESM_S_VOLTS,          0,              "Backplane +3.3V" },
 };
 
-struct esm_sensor_map esm_sensors_powerunit[] = {
+const struct esm_sensor_map esm_sensors_powerunit[] = {
        { ESM_S_UNKNOWN,        0,              "Power Unit" },
        { ESM_S_VOLTSx10,       0,              "Power Supply 1 +5V" },
        { ESM_S_VOLTSx10,       0,              "Power Supply 1 +12V" },
@@ -698,7 +698,7 @@ struct esm_sensor_map esm_sensors_powerunit[] = {
 void
 esm_devmap(struct esm_softc *sc, struct esm_devmap *devmap)
 {
-       struct esm_sensor_map   *sensor_map = NULL;
+       const struct esm_sensor_map *sensor_map = NULL;
        const char              *name = NULL, *fname = NULL;
        int                     mapsize = 0;
 
@@ -828,7 +828,7 @@ esm_devmap(struct esm_softc *sc, struct esm_devmap *de
 
 void
 esm_make_sensors(struct esm_softc *sc, struct esm_devmap *devmap,
-    struct esm_sensor_map *sensor_map, int mapsize)
+    const struct esm_sensor_map *sensor_map, int mapsize)
 {
        struct esm_smb_req      req;
        struct esm_smb_resp     resp;
blob - 9cdce94a36e88fb46230424e35e0ef1d9c3a8878
blob + 2b8109caffff2fa617f88eb012b0dcd0fd040c01
--- sys/dev/isa/it.c
+++ sys/dev/isa/it.c
@@ -70,7 +70,7 @@ int it_wdog_cb(void *, int);
 #define RFACT(x, y)            (RFACT_NONE * ((x) + (y)) / (y))
 
 
-struct {
+const struct {
        enum sensor_type        type;
        const char              *desc;
 } it_sensors[IT_EC_NUMSENSORS] = {
@@ -102,7 +102,7 @@ struct {
 };
 
 /* rfact values for voltage sensors */
-int it_vrfact[IT_VOLT_COUNT] = {
+const int it_vrfact[IT_VOLT_COUNT] = {
        RFACT_NONE,             /* VCORE_A      */
        RFACT_NONE,             /* VCORE_A      */
        RFACT_NONE,             /* +3.3V        */
@@ -114,12 +114,12 @@ int it_vrfact[IT_VOLT_COUNT] = {
        RFACT_NONE              /* VBAT         */
 };
 
-int it_fan_regs[] = {
+const int it_fan_regs[] = {
        IT_EC_FAN_TAC1, IT_EC_FAN_TAC2, IT_EC_FAN_TAC3,
        IT_EC_FAN_TAC4_LSB, IT_EC_FAN_TAC5_LSB
 };
 
-int it_fan_ext_regs[] = {
+const int it_fan_ext_regs[] = {
        IT_EC_FAN_EXT_TAC1, IT_EC_FAN_EXT_TAC2, IT_EC_FAN_EXT_TAC3,
        IT_EC_FAN_TAC4_MSB, IT_EC_FAN_TAC5_MSB
 };
-- 
Christian "naddy" Weisgerber                          na...@mips.inka.de

Reply via email to