Module Name:    src
Committed By:   jdolecek
Date:           Sat Jun 27 17:07:49 UTC 2020

Modified Files:
        src/sys/dev/ic: aic79xx.c aic7xxx.c
        src/sys/dev/microcode/aic7xxx: aic79xx_seq.h aic7xxx_seq.h aicasm.c

Log Message:
constify, NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/ic/aic79xx.c
cvs rdiff -u -r1.141 -r1.142 src/sys/dev/ic/aic7xxx.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/microcode/aic7xxx/aic79xx_seq.h
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/microcode/aic7xxx/aic7xxx_seq.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/microcode/aic7xxx/aicasm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/aic79xx.c
diff -u src/sys/dev/ic/aic79xx.c:1.55 src/sys/dev/ic/aic79xx.c:1.56
--- src/sys/dev/ic/aic79xx.c:1.55	Sat Jun 27 09:28:15 2020
+++ src/sys/dev/ic/aic79xx.c	Sat Jun 27 17:07:49 2020
@@ -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 @@ static void		ahd_dumpseq(struct ahd_soft
 #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 @@ ahd_loadseq(struct ahd_softc *ahd)
 	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 @@ ahd_loadseq(struct ahd_softc *ahd)
 }
 
 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 @@ ahd_check_patch(struct ahd_softc *ahd, s
 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 @@ ahd_download_instr(struct ahd_softc *ahd
 	/*
 	 * 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;

Index: src/sys/dev/ic/aic7xxx.c
diff -u src/sys/dev/ic/aic7xxx.c:1.141 src/sys/dev/ic/aic7xxx.c:1.142
--- src/sys/dev/ic/aic7xxx.c:1.141	Sat Jun 27 09:28:15 2020
+++ src/sys/dev/ic/aic7xxx.c	Sat Jun 27 17:07:49 2020
@@ -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 @@ static void		ahc_dumpseq(struct ahc_soft
 #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 @@ ahc_loadseq(struct ahc_softc *ahc)
 	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 @@ ahc_loadseq(struct ahc_softc *ahc)
 }
 
 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 @@ ahc_download_instr(struct ahc_softc *ahc
 	/*
 	 * 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 @@ ahc_download_instr(struct ahc_softc *ahc
 	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;

Index: src/sys/dev/microcode/aic7xxx/aic79xx_seq.h
diff -u src/sys/dev/microcode/aic7xxx/aic79xx_seq.h:1.11 src/sys/dev/microcode/aic7xxx/aic79xx_seq.h:1.12
--- src/sys/dev/microcode/aic7xxx/aic79xx_seq.h:1.11	Thu Nov 16 01:33:06 2006
+++ src/sys/dev/microcode/aic7xxx/aic79xx_seq.h	Sat Jun 27 17:07:49 2020
@@ -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 @@ ahd_patch0_func(struct ahd_softc *ahd)
 	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 @@ static struct patch {
 	{ ahd_patch22_func, 774, 11, 1 }
 };
 
-static struct cs {
+static const struct cs {
 	uint16_t	begin;
 	uint16_t	end;
 } critical_sections[] = {

Index: src/sys/dev/microcode/aic7xxx/aic7xxx_seq.h
diff -u src/sys/dev/microcode/aic7xxx/aic7xxx_seq.h:1.13 src/sys/dev/microcode/aic7xxx/aic7xxx_seq.h:1.14
--- src/sys/dev/microcode/aic7xxx/aic7xxx_seq.h:1.13	Sat Jun 27 16:48:01 2020
+++ src/sys/dev/microcode/aic7xxx/aic7xxx_seq.h	Sat Jun 27 17:07:49 2020
@@ -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 @@ ahc_patch0_func(struct ahc_softc *ahc)
 	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 @@ static struct patch {
 	{ ahc_patch4_func, 874, 12, 1 }
 };
 
-static struct cs {
+static const struct cs {
 	uint16_t	begin;
 	uint16_t	end;
 } critical_sections[] = {

Index: src/sys/dev/microcode/aic7xxx/aicasm.c
diff -u src/sys/dev/microcode/aic7xxx/aicasm.c:1.9 src/sys/dev/microcode/aic7xxx/aicasm.c:1.10
--- src/sys/dev/microcode/aic7xxx/aicasm.c:1.9	Mon Aug 15 08:52:33 2016
+++ src/sys/dev/microcode/aic7xxx/aicasm.c	Sat Jun 27 17:07:49 2020
@@ -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 @@ output_code(void)
 " *\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 @@ output_code(void)
 	}
 
 	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 @@ output_code(void)
 	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");

Reply via email to