Those .data symbols are already treated as const, so move to .rodata:
ffffffff82290610 g     O .data  00000000000005d0 ahc_pci_ident_table
ffffffff82290be0 g     O .data  0000000000000198 ahd_pci_ident_table

650 const struct ahc_pci_identity *
651 ahc_find_pci_device(pcireg_t id, pcireg_t subid, u_int func)
652 {
653         u_int64_t  full_id;
654         const struct       ahc_pci_identity *entry;
...
673         for (i = 0; i < NUM_ELEMENTS(ahc_pci_ident_table); i++) {
674                 entry = &ahc_pci_ident_table[i];
675                 if (entry->full_id == (full_id & entry->id_mask))
676                         return (entry);
677         }
678         return (NULL);

Same in ahd_find_pci_device().
Builds fine on amd64.

Feedback? Objection? OK?


Index: dev/pci/ahc_pci.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/ahc_pci.c,v
retrieving revision 1.62
diff -u -p -r1.62 ahc_pci.c
--- dev/pci/ahc_pci.c   11 Mar 2022 18:00:45 -0000      1.62
+++ dev/pci/ahc_pci.c   19 Oct 2022 14:21:51 -0000
@@ -261,7 +261,7 @@ static ahc_device_setup_t ahc_aha394XX_s
 static ahc_device_setup_t ahc_aha494XX_setup;
 static ahc_device_setup_t ahc_aha398XX_setup;
 
-struct ahc_pci_identity ahc_pci_ident_table [] =
+const struct ahc_pci_identity ahc_pci_ident_table [] =
 {
        /* aic7850 based controllers */
        {
Index: dev/pci/ahd_pci.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/ahd_pci.c,v
retrieving revision 1.28
diff -u -p -r1.28 ahd_pci.c
--- dev/pci/ahd_pci.c   11 Mar 2022 18:00:45 -0000      1.28
+++ dev/pci/ahd_pci.c   19 Oct 2022 14:26:33 -0000
@@ -146,7 +146,7 @@ ahd_device_setup_t ahd_aic7901A_setup;
 ahd_device_setup_t ahd_aic7902_setup;
 ahd_device_setup_t ahd_aic790X_setup;
 
-struct ahd_pci_identity ahd_pci_ident_table [] =
+const struct ahd_pci_identity ahd_pci_ident_table[] =
 {
        /* aic7901 based controllers */
        {
Index: dev/ic/aic79xx.h
===================================================================
RCS file: /cvs/src/sys/dev/ic/aic79xx.h,v
retrieving revision 1.29
diff -u -p -r1.29 aic79xx.h
--- dev/ic/aic79xx.h    9 Jan 2022 05:42:38 -0000       1.29
+++ dev/ic/aic79xx.h    19 Oct 2022 14:26:37 -0000
@@ -1316,7 +1316,7 @@ struct ahd_pci_identity {
        uint64_t                 id_mask;
        ahd_device_setup_t      *setup;
 };
-extern struct ahd_pci_identity ahd_pci_ident_table [];
+extern const struct ahd_pci_identity ahd_pci_ident_table[];
 extern const u_int ahd_num_pci_devs;
 
 /*************************** Function Declarations 
****************************/
Index: dev/ic/aic7xxxvar.h
===================================================================
RCS file: /cvs/src/sys/dev/ic/aic7xxxvar.h,v
retrieving revision 1.37
diff -u -p -r1.37 aic7xxxvar.h
--- dev/ic/aic7xxxvar.h 9 Jan 2022 05:42:38 -0000       1.37
+++ dev/ic/aic7xxxvar.h 19 Oct 2022 14:42:05 -0000
@@ -1161,7 +1161,7 @@ struct ahc_pci_identity {
        uint64_t                 id_mask;
        ahc_device_setup_t      *setup;
 };
-extern struct ahc_pci_identity ahc_pci_ident_table[];
+extern const struct ahc_pci_identity ahc_pci_ident_table[];
 
 /***************************** VL/EISA Declarations 
***************************/
 struct aic7770_identity {

Reply via email to