git: cd613d7cd981 - stable/13 - asmc: Make the model table const and local to asmc.c
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 18 May 2022 21:27:23 UTC
The branch stable/13 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=cd613d7cd9815c43f8261ac54a568eccbc523cc5
commit cd613d7cd9815c43f8261ac54a568eccbc523cc5
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-05-04 14:44:54 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-05-18 21:15:51 +0000
asmc: Make the model table const and local to asmc.c
No functional change intended.
(cherry picked from commit 27d4c6f86e15e818c390dfc2f3bb6ddf50148e71)
---
sys/dev/asmc/asmc.c | 10 +++++-----
sys/dev/asmc/asmcvar.h | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c
index b10c16ffbed0..7695b05a4ae1 100644
--- a/sys/dev/asmc/asmc.c
+++ b/sys/dev/asmc/asmc.c
@@ -130,7 +130,7 @@ struct asmc_model {
const char *smc_tempdescs[ASMC_TEMP_MAX];
};
-static struct asmc_model *asmc_match(device_t dev);
+static const struct asmc_model *asmc_match(device_t dev);
#define ASMC_SMS_FUNCS asmc_mb_sysctl_sms_x, asmc_mb_sysctl_sms_y, \
asmc_mb_sysctl_sms_z
@@ -153,7 +153,7 @@ static struct asmc_model *asmc_match(device_t dev);
#define ASMC_LIGHT_FUNCS_DISABLED NULL, NULL, NULL
-struct asmc_model asmc_models[] = {
+static const struct asmc_model asmc_models[] = {
{
"MacBook1,1", "Apple SMC MacBook Core Duo",
ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, NULL, NULL, NULL,
@@ -443,7 +443,7 @@ static unsigned int light_control = 0;
DRIVER_MODULE(asmc, acpi, asmc_driver, asmc_devclass, NULL, NULL);
MODULE_DEPEND(asmc, acpi, 1, 1, 1);
-static struct asmc_model *
+static const struct asmc_model *
asmc_match(device_t dev)
{
int i;
@@ -467,7 +467,7 @@ asmc_match(device_t dev)
static int
asmc_probe(device_t dev)
{
- struct asmc_model *model;
+ const struct asmc_model *model;
int rv;
if (resource_disabled("asmc", 0))
@@ -495,7 +495,7 @@ asmc_attach(device_t dev)
struct asmc_softc *sc = device_get_softc(dev);
struct sysctl_ctx_list *sysctlctx;
struct sysctl_oid *sysctlnode;
- struct asmc_model *model;
+ const struct asmc_model *model;
sc->sc_ioport = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
&sc->sc_rid_port, RF_ACTIVE);
diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h
index 70a2b24889c7..d55259122132 100644
--- a/sys/dev/asmc/asmcvar.h
+++ b/sys/dev/asmc/asmcvar.h
@@ -42,7 +42,7 @@ struct asmc_softc {
struct sysctl_oid *sc_temp_tree;
struct sysctl_oid *sc_sms_tree;
struct sysctl_oid *sc_light_tree;
- struct asmc_model *sc_model;
+ const struct asmc_model *sc_model;
int sc_rid_port;
int sc_rid_irq;
struct resource *sc_ioport;