Looking at symbols in /bsd .data again for .rodata candidates:
ffffffff82281b70 l     O .data  0000000000001688 asmc_prods

amsc(4) never writes, but a const table requires a const softc member:

263         for (i = 0; asmc_prods[i].pr_name && !sc->sc_prod; i++)
264                 if (!strncasecmp(asmc_prods[i].pr_name, hw_prod,
265                     strlen(asmc_prods[i].pr_name)))
266                         sc->sc_prod = &asmc_prods[i];
267         if (!sc->sc_prod)
268                 return;

Builds fine on amd64.  I don't have Apple hardware to test:
ffffffff820ce550 l     O .rodata        0000000000001688 asmc_prods


Feedback? Objection? OK?

Index: dev/acpi/asmc.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/asmc.c,v
retrieving revision 1.4
diff -u -p -r1.4 asmc.c
--- dev/acpi/asmc.c     21 Dec 2021 20:53:46 -0000      1.4
+++ dev/acpi/asmc.c     19 Oct 2022 14:10:01 -0000
@@ -75,7 +75,7 @@ struct asmc_softc {
        bus_space_tag_t          sc_iot;
        bus_space_handle_t       sc_ioh;
 
-       struct asmc_prod        *sc_prod;
+       const struct asmc_prod  *sc_prod;
        uint8_t                  sc_nfans;      /* number of fans */
        uint8_t                  sc_lightlen;   /* light data len */
        uint8_t                  sc_backlight;  /* keyboard backlight value */
@@ -119,7 +119,7 @@ const char *asmc_hids[] = {
        "APP0001", NULL
 };
 
-static struct asmc_prod asmc_prods[] = {
+static const struct asmc_prod asmc_prods[] = {
        { "MacBookAir", 1, {
                "TB0T", "TB1S", "TB1T", "TB2S", "TB2T", "TBXT", "TC0C", "TC0D",
                "TC0E", "TC0F", "TC0P", "TC1C", "TC1E", "TC2C", "TCFP", "TCGC",

Reply via email to