Source-Changes-HG archive

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

[src/trunk]: src/sys/dev constify, NFCI



details:   https://anonhg.NetBSD.org/src/rev/799f82140db4
branches:  trunk
changeset: 935214:799f82140db4
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat Jun 27 17:07:49 2020 +0000

description:
constify, NFCI

diffstat:

 sys/dev/ic/aic79xx.c                    |  20 ++++++++++----------
 sys/dev/ic/aic7xxx.c                    |  20 ++++++++++----------
 sys/dev/microcode/aic7xxx/aic79xx_seq.h |   6 +++---
 sys/dev/microcode/aic7xxx/aic7xxx_seq.h |   6 +++---
 sys/dev/microcode/aic7xxx/aicasm.c      |  10 +++++-----
 5 files changed, 31 insertions(+), 31 deletions(-)

diffs (254 lines):

diff -r 72df81530c9a -r 799f82140db4 sys/dev/ic/aic79xx.c
--- a/sys/dev/ic/aic79xx.c      Sat Jun 27 16:48:01 2020 +0000
+++ b/sys/dev/ic/aic79xx.c      Sat Jun 27 17:07:49 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic79xx.c,v 1.55 2020/06/27 09:28:15 jdolecek Exp $    */
+/*     $NetBSD: aic79xx.c,v 1.56 2020/06/27 17:07:49 jdolecek Exp $    */
 
 /*
  * Core routines and tables shareable across OS platforms.
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic79xx.c,v 1.55 2020/06/27 09:28:15 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic79xx.c,v 1.56 2020/06/27 17:07:49 jdolecek Exp $");
 
 #include <dev/ic/aic79xx_osm.h>
 #include <dev/ic/aic79xx_inline.h>
@@ -222,7 +222,7 @@
 #endif
 static void            ahd_loadseq(struct ahd_softc *ahd);
 static int             ahd_check_patch(struct ahd_softc *ahd,
-                                       struct patch **start_patch,
+                                       const struct patch **start_patch,
                                        u_int start_instr, u_int *skip_addr);
 static u_int           ahd_resolve_seqaddr(struct ahd_softc *ahd,
                                            u_int address);
@@ -8258,7 +8258,7 @@
        struct  cs cs_table[num_critical_sections];
        u_int   begin_set[num_critical_sections];
        u_int   end_set[num_critical_sections];
-       struct  patch *cur_patch;
+       const struct patch *cur_patch;
        u_int   cs_count;
        u_int   cur_cs;
        u_int   i;
@@ -8409,12 +8409,12 @@
 }
 
 static int
-ahd_check_patch(struct ahd_softc *ahd, struct patch **start_patch,
+ahd_check_patch(struct ahd_softc *ahd, const struct patch **start_patch,
                u_int start_instr, u_int *skip_addr)
 {
-       struct  patch *cur_patch;
-       struct  patch *last_patch;
-       u_int   num_patches;
+       const struct    patch *cur_patch;
+       const struct    patch *last_patch;
+       u_int           num_patches;
 
        num_patches = sizeof(patches)/sizeof(struct patch);
        last_patch = &patches[num_patches];
@@ -8447,7 +8447,7 @@
 static u_int
 ahd_resolve_seqaddr(struct ahd_softc *ahd, u_int address)
 {
-       struct patch *cur_patch;
+       const struct patch *cur_patch;
        int address_offset;
        u_int skip_addr;
        u_int i;
@@ -8484,7 +8484,7 @@
        /*
         * The firmware is always compiled into a little endian format.
         */
-       instr.integer = ahd_le32toh(*(uint32_t*)&seqprog[instrptr * 4]);
+       instr.integer = ahd_le32toh(*(const uint32_t*)&seqprog[instrptr * 4]);
 
        fmt1_ins = &instr.format1;
        fmt3_ins = NULL;
diff -r 72df81530c9a -r 799f82140db4 sys/dev/ic/aic7xxx.c
--- a/sys/dev/ic/aic7xxx.c      Sat Jun 27 16:48:01 2020 +0000
+++ b/sys/dev/ic/aic7xxx.c      Sat Jun 27 17:07:49 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic7xxx.c,v 1.141 2020/06/27 09:28:15 jdolecek Exp $   */
+/*     $NetBSD: aic7xxx.c,v 1.142 2020/06/27 17:07:49 jdolecek Exp $   */
 
 /*
  * Core routines and tables shareable across OS platforms.
@@ -39,7 +39,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: aic7xxx.c,v 1.141 2020/06/27 09:28:15 jdolecek Exp $
+ * $Id: aic7xxx.c,v 1.142 2020/06/27 17:07:49 jdolecek Exp $
  *
  * //depot/aic7xxx/aic7xxx/aic7xxx.c#112 $
  *
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic7xxx.c,v 1.141 2020/06/27 09:28:15 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic7xxx.c,v 1.142 2020/06/27 17:07:49 jdolecek Exp $");
 
 #include <dev/ic/aic7xxx_osm.h>
 #include <dev/ic/aic7xxx_inline.h>
@@ -232,7 +232,7 @@
 #endif
 static void            ahc_loadseq(struct ahc_softc *ahc);
 static int             ahc_check_patch(struct ahc_softc *ahc,
-                                       struct patch **start_patch,
+                                       const struct patch **start_patch,
                                        u_int start_instr, u_int *skip_addr);
 static void            ahc_download_instr(struct ahc_softc *ahc,
                                           u_int instrptr, uint8_t *dconsts);
@@ -6281,7 +6281,7 @@
        struct  cs cs_table[num_critical_sections];
        u_int   begin_set[num_critical_sections];
        u_int   end_set[num_critical_sections];
-       struct  patch *cur_patch;
+       const struct    patch *cur_patch;
        u_int   cs_count;
        u_int   cur_cs;
        u_int   i;
@@ -6371,11 +6371,11 @@
 }
 
 static int
-ahc_check_patch(struct ahc_softc *ahc, struct patch **start_patch,
+ahc_check_patch(struct ahc_softc *ahc, const struct patch **start_patch,
                u_int start_instr, u_int *skip_addr)
 {
-       struct  patch *cur_patch;
-       struct  patch *last_patch;
+       const struct patch *cur_patch;
+       const struct patch *last_patch;
        u_int   num_patches;
 
        num_patches = sizeof(patches)/sizeof(struct patch);
@@ -6417,7 +6417,7 @@
        /*
         * The firmware is always compiled into a little endian format.
         */
-       instr.integer = ahc_le32toh(*(uint32_t*)&seqprog[instrptr * 4]);
+       instr.integer = ahc_le32toh(*(const uint32_t*)&seqprog[instrptr * 4]);
 
        fmt1_ins = &instr.format1;
        fmt3_ins = NULL;
@@ -6434,7 +6434,7 @@
        case AIC_OP_JE:
        case AIC_OP_JZ:
        {
-               struct patch *cur_patch;
+               const struct patch *cur_patch;
                int address_offset;
                u_int address;
                u_int skip_addr;
diff -r 72df81530c9a -r 799f82140db4 sys/dev/microcode/aic7xxx/aic79xx_seq.h
--- a/sys/dev/microcode/aic7xxx/aic79xx_seq.h   Sat Jun 27 16:48:01 2020 +0000
+++ b/sys/dev/microcode/aic7xxx/aic79xx_seq.h   Sat Jun 27 17:07:49 2020 +0000
@@ -5,7 +5,7 @@
  * Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#96 $
  * Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#70 $
  */
-static uint8_t seqprog[] = {
+static const uint8_t seqprog[] = {
        0xff, 0x02, 0x06, 0x78,
        0x00, 0xea, 0x50, 0x59,
        0x01, 0xea, 0x04, 0x30,
@@ -978,7 +978,7 @@
        return (0);
 }
 
-static struct patch {
+static const struct patch {
        ahd_patch_func_t                *patch_func;
        uint32_t                 begin          :10,
                                 skip_instr     :10,
@@ -1117,7 +1117,7 @@
        { ahd_patch22_func, 774, 11, 1 }
 };
 
-static struct cs {
+static const struct cs {
        uint16_t        begin;
        uint16_t        end;
 } critical_sections[] = {
diff -r 72df81530c9a -r 799f82140db4 sys/dev/microcode/aic7xxx/aic7xxx_seq.h
--- a/sys/dev/microcode/aic7xxx/aic7xxx_seq.h   Sat Jun 27 16:48:01 2020 +0000
+++ b/sys/dev/microcode/aic7xxx/aic7xxx_seq.h   Sat Jun 27 17:07:49 2020 +0000
@@ -5,7 +5,7 @@
  * NetBSD: aic7xxx.seq,v 1.20 2019/06/04 10:15:22 msaitoh Exp $
  * NetBSD: aic7xxx.reg,v 1.4 2005/12/11 12:22:18 christos Exp $
  */
-static uint8_t seqprog[] = {
+static const uint8_t seqprog[] = {
        0xb2, 0x00, 0x00, 0x08,
        0xf7, 0x11, 0x22, 0x08,
        0x00, 0x65, 0xec, 0x59,
@@ -1090,7 +1090,7 @@
        return (0);
 }
 
-static struct patch {
+static const struct patch {
        ahc_patch_func_t                *patch_func;
        uint32_t                 begin          :10,
                                 skip_instr     :10,
@@ -1300,7 +1300,7 @@
        { ahc_patch4_func, 874, 12, 1 }
 };
 
-static struct cs {
+static const struct cs {
        uint16_t        begin;
        uint16_t        end;
 } critical_sections[] = {
diff -r 72df81530c9a -r 799f82140db4 sys/dev/microcode/aic7xxx/aicasm.c
--- a/sys/dev/microcode/aic7xxx/aicasm.c        Sat Jun 27 16:48:01 2020 +0000
+++ b/sys/dev/microcode/aic7xxx/aicasm.c        Sat Jun 27 17:07:49 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aicasm.c,v 1.9 2016/08/15 08:52:33 maxv Exp $  */
+/*     $NetBSD: aicasm.c,v 1.10 2020/06/27 17:07:49 jdolecek Exp $     */
 
 /*
  * Aic7xxx SCSI host adapter firmware asssembler
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: aicasm.c,v 1.9 2016/08/15 08:52:33 maxv Exp $");
+__RCSID("$NetBSD: aicasm.c,v 1.10 2020/06/27 17:07:49 jdolecek Exp $");
 
 #include <sys/types.h>
 #include <sys/mman.h>
@@ -366,7 +366,7 @@
 " *\n"
 "%s */\n", versions);
 
-       fprintf(ofile, "static uint8_t seqprog[] = {\n");
+       fprintf(ofile, "static const uint8_t seqprog[] = {\n");
        for (cur_instr = STAILQ_FIRST(&seq_program);
             cur_instr != NULL;
             cur_instr = STAILQ_NEXT(cur_instr, links)) {
@@ -419,7 +419,7 @@
        }
 
        fprintf(ofile,
-"static struct patch {\n"
+"static const struct patch {\n"
 "      %spatch_func_t          *patch_func;\n"
 "      uint32_t                 begin          :10,\n"
 "                               skip_instr     :10,\n"
@@ -439,7 +439,7 @@
        fprintf(ofile, "\n};\n\n");
 
        fprintf(ofile,
-"static struct cs {\n"
+"static const struct cs {\n"
 "      uint16_t        begin;\n"
 "      uint16_t        end;\n"
 "} critical_sections[] = {\n");



Home | Main Index | Thread Index | Old Index