Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev - Sprinkle static and const. No functional change.



details:   https://anonhg.NetBSD.org/src/rev/a4d9f2eabe1c
branches:  trunk
changeset: 355668:a4d9f2eabe1c
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Aug 09 04:45:38 2017 +0000

description:
- Sprinkle static and const. No functional change.
- Print chip ID in hexadecimal instead of octal in def_match().

diffstat:

 sys/dev/ic/nslm7x.c    |  40 ++++++++++++++++++++--------------------
 sys/dev/ic/nslm7xvar.h |   4 ++--
 sys/dev/isa/wbsio.c    |  17 ++++++++---------
 3 files changed, 30 insertions(+), 31 deletions(-)

diffs (226 lines):

diff -r 780b63c3bafd -r a4d9f2eabe1c sys/dev/ic/nslm7x.c
--- a/sys/dev/ic/nslm7x.c       Wed Aug 09 04:29:36 2017 +0000
+++ b/sys/dev/ic/nslm7x.c       Wed Aug 09 04:45:38 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nslm7x.c,v 1.67 2017/07/20 02:27:36 msaitoh Exp $ */
+/*     $NetBSD: nslm7x.c,v 1.68 2017/08/09 04:45:38 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nslm7x.c,v 1.67 2017/07/20 02:27:36 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nslm7x.c,v 1.68 2017/08/09 04:45:38 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -80,7 +80,7 @@
 static void lm_refresh(void *);
 
 static void lm_generic_banksel(struct lm_softc *, int);
-static void lm_setup_sensors(struct lm_softc *, struct lm_sensor *);
+static void lm_setup_sensors(struct lm_softc *, const struct lm_sensor *);
 static void lm_refresh_sensor_data(struct lm_softc *);
 static void lm_refresh_volt(struct lm_softc *, int);
 static void lm_refresh_temp(struct lm_softc *, int);
@@ -123,7 +123,7 @@
 };
 
 /* LM78/78J/79/81 */
-static struct lm_sensor lm78_sensors[] = {
+static const struct lm_sensor lm78_sensors[] = {
        /* Voltage */
        {
                .desc = "VCore A",
@@ -222,7 +222,7 @@
 };
 
 /* W83627HF */
-static struct lm_sensor w83627hf_sensors[] = {
+static const struct lm_sensor w83627hf_sensors[] = {
        /* Voltage */
        {
                .desc = "VCore A",
@@ -361,7 +361,7 @@
  * need special treatment, also because the reference voltage is 2.048 V
  * instead of the traditional 3.6 V.
  */
-static struct lm_sensor w83627ehf_sensors[] = {
+static const struct lm_sensor w83627ehf_sensors[] = {
        /* Voltage */
        {
                .desc = "VCore",
@@ -500,7 +500,7 @@
 };
 
 /*  W83627DHG */
-static struct lm_sensor w83627dhg_sensors[] = {
+static const struct lm_sensor w83627dhg_sensors[] = {
        /* Voltage */
        {
                .desc = "VCore",
@@ -631,7 +631,7 @@
 };
 
 /* W83637HF */
-static struct lm_sensor w83637hf_sensors[] = {
+static const struct lm_sensor w83637hf_sensors[] = {
        /* Voltage */
        {
                .desc = "VCore",
@@ -746,7 +746,7 @@
 };
 
 /* W83697HF */
-static struct lm_sensor w83697hf_sensors[] = {
+static const struct lm_sensor w83697hf_sensors[] = {
        /* Voltage */
        {
                .desc = "VCore",
@@ -859,7 +859,7 @@
  * +5V, but using the values from the W83782D datasheets seems to
  * provide sensible results.
  */
-static struct lm_sensor w83781d_sensors[] = {
+static const struct lm_sensor w83781d_sensors[] = {
        /* Voltage */
        {
                .desc = "VCore A",
@@ -974,7 +974,7 @@
 };
 
 /* W83782D */
-static struct lm_sensor w83782d_sensors[] = {
+static const struct lm_sensor w83782d_sensors[] = {
        /* Voltage */
        {
                .desc = "VCore",
@@ -1105,7 +1105,7 @@
 };
 
 /* W83783S */
-static struct lm_sensor w83783s_sensors[] = {
+static const struct lm_sensor w83783s_sensors[] = {
        /* Voltage */
        {
                .desc = "VCore",
@@ -1204,7 +1204,7 @@
 };
 
 /* W83791D */
-static struct lm_sensor w83791d_sensors[] = {
+static const struct lm_sensor w83791d_sensors[] = {
        /* Voltage */
        {
                .desc = "VCore",
@@ -1359,7 +1359,7 @@
 };
 
 /* W83792D */
-static struct lm_sensor w83792d_sensors[] = {
+static const struct lm_sensor w83792d_sensors[] = {
        /* Voltage */
        {
                .desc = "VCore A",
@@ -1522,7 +1522,7 @@
 };
 
 /* AS99127F */
-static struct lm_sensor as99127f_sensors[] = {
+static const struct lm_sensor as99127f_sensors[] = {
        /* Voltage */
        {
                .desc = "VCore A",
@@ -1637,7 +1637,7 @@
 };
 
 /* NCT6776F */
-static struct lm_sensor nct6776f_sensors[] = {
+static const struct lm_sensor nct6776f_sensors[] = {
        /* Voltage */
        {
                .desc = "VCore",
@@ -1785,7 +1785,7 @@
 };
 
 /* NCT6779D */
-static struct lm_sensor nct6779d_sensors[] = {
+static const struct lm_sensor nct6779d_sensors[] = {
        /* Voltage */
        {
                .desc = "VCore",
@@ -2139,12 +2139,12 @@
 static int
 def_match(struct lm_softc *sc)
 {
-       int chipid;
+       uint8_t chipid;
 
        chipid = (*sc->lm_readreg)(sc, LMD_CHIPID) & LM_ID_MASK;
        aprint_naive("\n");
        aprint_normal("\n");
-       aprint_error_dev(sc->sc_dev, "Unknown chip (ID %d)\n", chipid);
+       aprint_error_dev(sc->sc_dev, "Unknown chip (ID %02x)\n", chipid);
 
        lm_setup_sensors(sc, lm78_sensors);
        sc->refresh_sensor_data = lm_refresh_sensor_data;
@@ -2346,7 +2346,7 @@
 }
 
 static void
-lm_setup_sensors(struct lm_softc *sc, struct lm_sensor *sensors)
+lm_setup_sensors(struct lm_softc *sc, const struct lm_sensor *sensors)
 {
        int i;
 
diff -r 780b63c3bafd -r a4d9f2eabe1c sys/dev/ic/nslm7xvar.h
--- a/sys/dev/ic/nslm7xvar.h    Wed Aug 09 04:29:36 2017 +0000
+++ b/sys/dev/ic/nslm7xvar.h    Wed Aug 09 04:45:38 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nslm7xvar.h,v 1.30 2017/07/11 10:10:51 msaitoh Exp $ */
+/*     $NetBSD: nslm7xvar.h,v 1.31 2017/08/09 04:45:38 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -167,7 +167,7 @@
        uint8_t (*lm_readreg)(struct lm_softc *, int);
        void (*lm_writereg)(struct lm_softc *, int, int);
 
-       struct lm_sensor *lm_sensors;
+       const struct lm_sensor *lm_sensors;
        uint8_t chipid;
        uint8_t vrm9;
        uint8_t sioid;
diff -r 780b63c3bafd -r a4d9f2eabe1c sys/dev/isa/wbsio.c
--- a/sys/dev/isa/wbsio.c       Wed Aug 09 04:29:36 2017 +0000
+++ b/sys/dev/isa/wbsio.c       Wed Aug 09 04:45:38 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wbsio.c,v 1.12 2017/07/11 10:10:51 msaitoh Exp $       */
+/*     $NetBSD: wbsio.c,v 1.13 2017/08/09 04:45:38 msaitoh Exp $       */
 /*     $OpenBSD: wbsio.c,v 1.10 2015/03/14 03:38:47 jsg Exp $  */
 /*
  * Copyright (c) 2008 Mark Kettenis <kettenis%openbsd.org@localhost>
@@ -43,14 +43,13 @@
        struct isa_io           sc_io;
 };
 
-int    wbsio_probe(device_t, cfdata_t, void *);
-void   wbsio_attach(device_t, device_t, void *);
-int    wbsio_detach(device_t, int);
-int    wbsio_rescan(device_t, const char *, const int *);
-void   wbsio_childdet(device_t, device_t);
-int    wbsio_print(void *, const char *);
-
-static int wbsio_search(device_t, cfdata_t, const int *, void *);
+static int     wbsio_probe(device_t, cfdata_t, void *);
+static void    wbsio_attach(device_t, device_t, void *);
+static int     wbsio_detach(device_t, int);
+static int     wbsio_rescan(device_t, const char *, const int *);
+static void    wbsio_childdet(device_t, device_t);
+static int     wbsio_print(void *, const char *);
+static int     wbsio_search(device_t, cfdata_t, const int *, void *);
 
 CFATTACH_DECL2_NEW(wbsio, sizeof(struct wbsio_softc),
     wbsio_probe, wbsio_attach, wbsio_detach, NULL,



Home | Main Index | Thread Index | Old Index