summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2022-09-02 20:06:57 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2022-09-02 20:06:57 +0000
commit0480d2ad8bcef1a71cd9df2d62518679d800bc78 (patch)
tree13472779310ee770fe03933432f3cb745968b93d /sys
parent5c3b8919b72b59be79fac969c544203b65e7a4dd (diff)
Constify nam2blk[], chrtoblktbl[] and octeon devmap[].
ok mpi@ millert@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/alpha/autoconf.c4
-rw-r--r--sys/arch/alpha/alpha/conf.c6
-rw-r--r--sys/arch/amd64/amd64/autoconf.c4
-rw-r--r--sys/arch/amd64/amd64/conf.c6
-rw-r--r--sys/arch/arm/arm/conf.c6
-rw-r--r--sys/arch/arm64/arm64/autoconf.c4
-rw-r--r--sys/arch/arm64/arm64/conf.c6
-rw-r--r--sys/arch/armv7/armv7/autoconf.c4
-rw-r--r--sys/arch/hppa/hppa/autoconf.c4
-rw-r--r--sys/arch/hppa/hppa/conf.c6
-rw-r--r--sys/arch/i386/i386/autoconf.c4
-rw-r--r--sys/arch/i386/i386/conf.c6
-rw-r--r--sys/arch/landisk/landisk/autoconf.c4
-rw-r--r--sys/arch/landisk/landisk/conf.c6
-rw-r--r--sys/arch/loongson/loongson/autoconf.c4
-rw-r--r--sys/arch/loongson/loongson/conf.c6
-rw-r--r--sys/arch/luna88k/luna88k/autoconf.c4
-rw-r--r--sys/arch/luna88k/luna88k/conf.c6
-rw-r--r--sys/arch/macppc/macppc/autoconf.c6
-rw-r--r--sys/arch/macppc/macppc/conf.c6
-rw-r--r--sys/arch/octeon/octeon/autoconf.c8
-rw-r--r--sys/arch/octeon/octeon/conf.c6
-rw-r--r--sys/arch/powerpc64/powerpc64/autoconf.c4
-rw-r--r--sys/arch/powerpc64/powerpc64/conf.c6
-rw-r--r--sys/arch/riscv64/riscv64/autoconf.c4
-rw-r--r--sys/arch/riscv64/riscv64/conf.c6
-rw-r--r--sys/arch/sparc64/sparc64/autoconf.c4
-rw-r--r--sys/arch/sparc64/sparc64/conf.c6
-rw-r--r--sys/kern/subr_disk.c4
-rw-r--r--sys/sys/conf.h6
30 files changed, 78 insertions, 78 deletions
diff --git a/sys/arch/alpha/alpha/autoconf.c b/sys/arch/alpha/alpha/autoconf.c
index cc8c989a0fd..a1854f7ad73 100644
--- a/sys/arch/alpha/alpha/autoconf.c
+++ b/sys/arch/alpha/alpha/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.38 2018/01/27 22:55:23 naddy Exp $ */
+/* $OpenBSD: autoconf.c,v 1.39 2022/09/02 20:06:55 miod Exp $ */
/* $NetBSD: autoconf.c,v 1.16 1996/11/13 21:13:04 cgd Exp $ */
/*
@@ -220,7 +220,7 @@ device_register(dev, aux)
(*platform.device_register)(dev, aux);
}
-struct nam2blk nam2blk[] = {
+const struct nam2blk nam2blk[] = {
{ "wd", 0 },
{ "cd", 3 },
{ "fd", 4 },
diff --git a/sys/arch/alpha/alpha/conf.c b/sys/arch/alpha/alpha/conf.c
index 61f25eafe28..b13a46e703c 100644
--- a/sys/arch/alpha/alpha/conf.c
+++ b/sys/arch/alpha/alpha/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.90 2021/11/11 10:03:08 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.91 2022/09/02 20:06:55 miod Exp $ */
/* $NetBSD: conf.c,v 1.16 1996/10/18 21:26:57 cgd Exp $ */
/*-
@@ -252,7 +252,7 @@ getnulldev()
return makedev(mem_no, 2);
}
-int chrtoblktbl[] = {
+const int chrtoblktbl[] = {
/*VCHR*/ /*VBLK*/
/* 0 */ NODEV,
/* 1 */ NODEV,
@@ -293,4 +293,4 @@ int chrtoblktbl[] = {
/* 36 */ 0,
/* 37 */ 4, /* fd */
};
-int nchrtoblktbl = nitems(chrtoblktbl);
+const int nchrtoblktbl = nitems(chrtoblktbl);
diff --git a/sys/arch/amd64/amd64/autoconf.c b/sys/arch/amd64/amd64/autoconf.c
index 6ae7b28f6d9..e11c2f7aa80 100644
--- a/sys/arch/amd64/amd64/autoconf.c
+++ b/sys/arch/amd64/amd64/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.53 2019/01/11 06:25:06 mlarkin Exp $ */
+/* $OpenBSD: autoconf.c,v 1.54 2022/09/02 20:06:55 miod Exp $ */
/* $NetBSD: autoconf.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
@@ -223,7 +223,7 @@ diskconf(void)
#endif /* HIBERNATE */
}
-struct nam2blk nam2blk[] = {
+const struct nam2blk nam2blk[] = {
{ "wd", 0 },
{ "fd", 2 },
{ "sd", 4 },
diff --git a/sys/arch/amd64/amd64/conf.c b/sys/arch/amd64/amd64/conf.c
index e0a772ebd33..eb217a5c5ac 100644
--- a/sys/arch/amd64/amd64/conf.c
+++ b/sys/arch/amd64/amd64/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.75 2022/06/28 14:43:50 visa Exp $ */
+/* $OpenBSD: conf.c,v 1.76 2022/09/02 20:06:55 miod Exp $ */
/*
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -331,7 +331,7 @@ getnulldev(void)
return makedev(mem_no, 2);
}
-int chrtoblktbl[] = {
+const int chrtoblktbl[] = {
/*VCHR*/ /*VBLK*/
/* 0 */ NODEV,
/* 1 */ NODEV,
@@ -383,7 +383,7 @@ int chrtoblktbl[] = {
/* 47 */ 17, /* rd */
};
-int nchrtoblktbl = nitems(chrtoblktbl);
+const int nchrtoblktbl = nitems(chrtoblktbl);
/*
* In order to map BSD bdev numbers of disks to their BIOS equivalents
diff --git a/sys/arch/arm/arm/conf.c b/sys/arch/arm/arm/conf.c
index a97a2092ed3..3298eb60d67 100644
--- a/sys/arch/arm/arm/conf.c
+++ b/sys/arch/arm/arm/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.58 2021/11/11 10:03:08 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.59 2022/09/02 20:06:55 miod Exp $ */
/* $NetBSD: conf.c,v 1.10 2002/04/19 01:04:38 wiz Exp $ */
/*
@@ -415,7 +415,7 @@ iszerodev(dev_t dev)
}
-int chrtoblktbl[] = {
+const int chrtoblktbl[] = {
/*VCHR*/ /*VBLK*/
/* 0 */ NODEV,
/* 1 */ NODEV,
@@ -445,7 +445,7 @@ int chrtoblktbl[] = {
/* 25 */ NODEV,
/* 26 */ 26, /* cd */
};
-int nchrtoblktbl = nitems(chrtoblktbl);
+const int nchrtoblktbl = nitems(chrtoblktbl);
dev_t
getnulldev(void)
diff --git a/sys/arch/arm64/arm64/autoconf.c b/sys/arch/arm64/arm64/autoconf.c
index bda3cb3f6b0..6006317d325 100644
--- a/sys/arch/arm64/arm64/autoconf.c
+++ b/sys/arch/arm64/arm64/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.12 2021/02/21 14:55:16 tobhe Exp $ */
+/* $OpenBSD: autoconf.c,v 1.13 2022/09/02 20:06:55 miod Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
*
@@ -109,7 +109,7 @@ device_register(struct device *dev, void *aux)
{
}
-struct nam2blk nam2blk[] = {
+const struct nam2blk nam2blk[] = {
{ "wd", 0 },
{ "sd", 4 },
{ "cd", 6 },
diff --git a/sys/arch/arm64/arm64/conf.c b/sys/arch/arm64/arm64/conf.c
index 543b8241dda..b2713bc2577 100644
--- a/sys/arch/arm64/arm64/conf.c
+++ b/sys/arch/arm64/arm64/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.19 2021/11/11 10:03:08 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.20 2022/09/02 20:06:55 miod Exp $ */
/*
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -273,7 +273,7 @@ getnulldev(void)
return makedev(CMAJ_MM, 2);
}
-int chrtoblktbl[] = {
+const int chrtoblktbl[] = {
/*VCHR*/ /*VBLK*/
/* 0 */ NODEV,
/* 1 */ NODEV,
@@ -325,7 +325,7 @@ int chrtoblktbl[] = {
/* 47 */ 17, /* rd */
};
-int nchrtoblktbl = nitems(chrtoblktbl);
+const int nchrtoblktbl = nitems(chrtoblktbl);
/*
* In order to map BSD bdev numbers of disks to their BIOS equivalents
diff --git a/sys/arch/armv7/armv7/autoconf.c b/sys/arch/armv7/armv7/autoconf.c
index 00134c44423..480f7796e42 100644
--- a/sys/arch/armv7/armv7/autoconf.c
+++ b/sys/arch/armv7/armv7/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.10 2021/03/25 04:12:01 jsg Exp $ */
+/* $OpenBSD: autoconf.c,v 1.11 2022/09/02 20:06:55 miod Exp $ */
/* $NetBSD: autoconf.c,v 1.2 2001/09/05 16:17:36 matt Exp $ */
/*
@@ -145,7 +145,7 @@ diskconf(void)
dumpconf();
}
-struct nam2blk nam2blk[] = {
+const struct nam2blk nam2blk[] = {
{ "wd", 16 },
{ "rd", 18 },
{ "vnd", 19 },
diff --git a/sys/arch/hppa/hppa/autoconf.c b/sys/arch/hppa/hppa/autoconf.c
index 0ee7b9066c2..ffbe9bea88e 100644
--- a/sys/arch/hppa/hppa/autoconf.c
+++ b/sys/arch/hppa/hppa/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.62 2018/01/27 22:55:23 naddy Exp $ */
+/* $OpenBSD: autoconf.c,v 1.63 2022/09/02 20:06:55 miod Exp $ */
/*
* Copyright (c) 1998-2003 Michael Shalayeff
@@ -511,7 +511,7 @@ diskconf(void)
dumpconf();
}
-struct nam2blk nam2blk[] = {
+const struct nam2blk nam2blk[] = {
{ "vnd", 2 },
{ "rd", 3 },
{ "sd", 4 },
diff --git a/sys/arch/hppa/hppa/conf.c b/sys/arch/hppa/hppa/conf.c
index bdb3696734c..4e62dd5079f 100644
--- a/sys/arch/hppa/hppa/conf.c
+++ b/sys/arch/hppa/hppa/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.73 2022/04/20 14:21:56 deraadt Exp $ */
+/* $OpenBSD: conf.c,v 1.74 2022/09/02 20:06:55 miod Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -208,7 +208,7 @@ int mem_no = 2; /* major device number of memory special file */
*/
dev_t swapdev = makedev(0, 0);
-int chrtoblktbl[] = {
+const int chrtoblktbl[] = {
/*VCHR*/ /*VBLK*/
/* 0 */ NODEV,
/* 1 */ NODEV,
@@ -251,7 +251,7 @@ int chrtoblktbl[] = {
/* 38 */ NODEV,
/* 39 */ 8, /* wd */
};
-int nchrtoblktbl = nitems(chrtoblktbl);
+const int nchrtoblktbl = nitems(chrtoblktbl);
/*
* Returns true if dev is /dev/zero.
diff --git a/sys/arch/i386/i386/autoconf.c b/sys/arch/i386/i386/autoconf.c
index 31e9b42f68f..e23c1064816 100644
--- a/sys/arch/i386/i386/autoconf.c
+++ b/sys/arch/i386/i386/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.106 2019/12/08 12:25:30 mpi Exp $ */
+/* $OpenBSD: autoconf.c,v 1.107 2022/09/02 20:06:55 miod Exp $ */
/* $NetBSD: autoconf.c,v 1.20 1996/05/03 19:41:56 christos Exp $ */
/*-
@@ -260,7 +260,7 @@ diskconf(void)
#endif /* HIBERNATE */
}
-struct nam2blk nam2blk[] = {
+const struct nam2blk nam2blk[] = {
{ "wd", 0 },
{ "fd", 2 },
{ "sd", 4 },
diff --git a/sys/arch/i386/i386/conf.c b/sys/arch/i386/i386/conf.c
index 5fdc39bce3e..4c7365f282b 100644
--- a/sys/arch/i386/i386/conf.c
+++ b/sys/arch/i386/i386/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.173 2022/06/28 14:43:50 visa Exp $ */
+/* $OpenBSD: conf.c,v 1.174 2022/09/02 20:06:56 miod Exp $ */
/* $NetBSD: conf.c,v 1.75 1996/05/03 19:40:20 christos Exp $ */
/*
@@ -329,7 +329,7 @@ getnulldev(void)
return makedev(mem_no, 2);
}
-int chrtoblktbl[] = {
+const int chrtoblktbl[] = {
/*VCHR*/ /*VBLK*/
/* 0 */ NODEV,
/* 1 */ NODEV,
@@ -380,7 +380,7 @@ int chrtoblktbl[] = {
/* 46 */ NODEV,
/* 47 */ 17, /* rd */
};
-int nchrtoblktbl = nitems(chrtoblktbl);
+const int nchrtoblktbl = nitems(chrtoblktbl);
/*
* In order to map BSD bdev numbers of disks to their BIOS equivalents
diff --git a/sys/arch/landisk/landisk/autoconf.c b/sys/arch/landisk/landisk/autoconf.c
index 2b756bf4365..345c0cb6c3f 100644
--- a/sys/arch/landisk/landisk/autoconf.c
+++ b/sys/arch/landisk/landisk/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.12 2018/01/27 22:55:23 naddy Exp $ */
+/* $OpenBSD: autoconf.c,v 1.13 2022/09/02 20:06:56 miod Exp $ */
/* $NetBSD: autoconf.c,v 1.1 2006/09/01 21:26:18 uwe Exp $ */
/*-
@@ -73,7 +73,7 @@ diskconf(void)
dumpconf();
}
-struct nam2blk nam2blk[] = {
+const struct nam2blk nam2blk[] = {
{ "wd", 16 },
{ "rd", 18 },
{ "vnd", 19 },
diff --git a/sys/arch/landisk/landisk/conf.c b/sys/arch/landisk/landisk/conf.c
index 1ceb054ba1e..d20bd3ca471 100644
--- a/sys/arch/landisk/landisk/conf.c
+++ b/sys/arch/landisk/landisk/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.44 2021/11/11 10:03:09 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.45 2022/09/02 20:06:56 miod Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@@ -397,7 +397,7 @@ iszerodev(dev)
}
-int chrtoblktbl[] = {
+const int chrtoblktbl[] = {
/*VCHR*/ /*VBLK*/
/* 0 */ NODEV,
/* 1 */ NODEV,
@@ -427,7 +427,7 @@ int chrtoblktbl[] = {
/* 25 */ NODEV,
/* 26 */ 26, /* cd */
};
-int nchrtoblktbl = nitems(chrtoblktbl);
+const int nchrtoblktbl = nitems(chrtoblktbl);
dev_t
diff --git a/sys/arch/loongson/loongson/autoconf.c b/sys/arch/loongson/loongson/autoconf.c
index 77b9b90d93a..303a350c8ef 100644
--- a/sys/arch/loongson/loongson/autoconf.c
+++ b/sys/arch/loongson/loongson/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.10 2018/04/20 14:08:12 visa Exp $ */
+/* $OpenBSD: autoconf.c,v 1.11 2022/09/02 20:06:56 miod Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
*
@@ -149,7 +149,7 @@ device_register(struct device *dev, void *aux)
(*sys_platform->device_register)(dev, aux);
}
-struct nam2blk nam2blk[] = {
+const struct nam2blk nam2blk[] = {
{ "sd", 0 },
{ "vnd", 2 },
{ "cd", 3 },
diff --git a/sys/arch/loongson/loongson/conf.c b/sys/arch/loongson/loongson/conf.c
index 3b939aee0cb..a7dea856e54 100644
--- a/sys/arch/loongson/loongson/conf.c
+++ b/sys/arch/loongson/loongson/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.31 2021/11/11 10:03:09 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.32 2022/09/02 20:06:56 miod Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -276,7 +276,7 @@ getnulldev()
}
-int chrtoblktbl[] = {
+const int chrtoblktbl[] = {
/* VCHR VBLK */
/* 0 */ NODEV,
/* 1 */ NODEV,
@@ -303,7 +303,7 @@ int chrtoblktbl[] = {
/* 22 */ 8 /* rd */
};
-int nchrtoblktbl = nitems(chrtoblktbl);
+const int nchrtoblktbl = nitems(chrtoblktbl);
#include <dev/cons.h>
diff --git a/sys/arch/luna88k/luna88k/autoconf.c b/sys/arch/luna88k/luna88k/autoconf.c
index c530c8802bb..dc589585ce5 100644
--- a/sys/arch/luna88k/luna88k/autoconf.c
+++ b/sys/arch/luna88k/luna88k/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.25 2022/08/13 06:44:48 jsg Exp $ */
+/* $OpenBSD: autoconf.c,v 1.26 2022/09/02 20:06:56 miod Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -175,7 +175,7 @@ device_register(struct device *dev, void *aux)
}
}
-struct nam2blk nam2blk[] = {
+const struct nam2blk nam2blk[] = {
{ "sd", 4 },
{ "cd", 6 },
{ "rd", 7 },
diff --git a/sys/arch/luna88k/luna88k/conf.c b/sys/arch/luna88k/luna88k/conf.c
index d496ea3ebda..9c51bfbaa43 100644
--- a/sys/arch/luna88k/luna88k/conf.c
+++ b/sys/arch/luna88k/luna88k/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.35 2021/11/11 10:03:09 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.36 2022/09/02 20:06:56 miod Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -205,7 +205,7 @@ getnulldev()
return makedev(mem_no, 2);
}
-int chrtoblktbl[] = {
+const int chrtoblktbl[] = {
/*VCHR*/ /*VBLK*/
/* 0 */ NODEV,
/* 1 */ NODEV,
@@ -228,4 +228,4 @@ int chrtoblktbl[] = {
/* 18 */ 7, /* rd */
/* 19 */ 8, /* vnd */
};
-int nchrtoblktbl = nitems(chrtoblktbl);
+const int nchrtoblktbl = nitems(chrtoblktbl);
diff --git a/sys/arch/macppc/macppc/autoconf.c b/sys/arch/macppc/macppc/autoconf.c
index 935231faee0..56499dbdc7a 100644
--- a/sys/arch/macppc/macppc/autoconf.c
+++ b/sys/arch/macppc/macppc/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.46 2019/09/03 17:51:52 deraadt Exp $ */
+/* $OpenBSD: autoconf.c,v 1.47 2022/09/02 20:06:56 miod Exp $ */
/*
* Copyright (c) 1996, 1997 Per Fogelstrom
* Copyright (c) 1995 Theo de Raadt
@@ -37,7 +37,7 @@
* from: Utah Hdr: autoconf.c 1.31 91/01/21
*
* from: @(#)autoconf.c 8.1 (Berkeley) 6/10/93
- * $Id: autoconf.c,v 1.46 2019/09/03 17:51:52 deraadt Exp $
+ * $Id: autoconf.c,v 1.47 2022/09/02 20:06:56 miod Exp $
*/
/*
@@ -280,7 +280,7 @@ diskconf(void)
dumpconf();
}
-struct nam2blk nam2blk[] = {
+const struct nam2blk nam2blk[] = {
{ "wd", 0 },
{ "sd", 2 },
{ "cd", 3 },
diff --git a/sys/arch/macppc/macppc/conf.c b/sys/arch/macppc/macppc/conf.c
index e28e9cc911a..e4f01b80b3c 100644
--- a/sys/arch/macppc/macppc/conf.c
+++ b/sys/arch/macppc/macppc/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.74 2021/11/11 10:03:09 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.75 2022/09/02 20:06:56 miod Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom
@@ -267,7 +267,7 @@ getnulldev(void)
return makedev(mem_no, 2);
}
-int chrtoblktbl[] = {
+const int chrtoblktbl[] = {
/*VCHR*/ /*VBLK*/
/* 0 */ NODEV,
/* 1 */ NODEV,
@@ -290,7 +290,7 @@ int chrtoblktbl[] = {
/* 18 */ NODEV,
/* 19 */ 14, /* vnd */
};
-int nchrtoblktbl = nitems(chrtoblktbl);
+const int nchrtoblktbl = nitems(chrtoblktbl);
#include <dev/cons.h>
diff --git a/sys/arch/octeon/octeon/autoconf.c b/sys/arch/octeon/octeon/autoconf.c
index d9f401f51c9..620c939dcff 100644
--- a/sys/arch/octeon/octeon/autoconf.c
+++ b/sys/arch/octeon/octeon/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.16 2019/07/12 03:03:48 visa Exp $ */
+/* $OpenBSD: autoconf.c,v 1.17 2022/09/02 20:06:56 miod Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
*
@@ -56,14 +56,14 @@ struct devmap {
enum devclass
findtype(void)
{
- static struct devmap devmap[] = {
+ static const struct devmap devmap[] = {
{ "wd", DV_DISK },
{ "sd", DV_DISK },
{ "octcf", DV_DISK },
{ "amdcf", DV_DISK },
{ NULL, DV_IFNET }
};
- struct devmap *dp = &devmap[0];
+ const struct devmap *dp = &devmap[0];
if (strlen(bootdev) < 2)
return DV_DISK;
@@ -166,7 +166,7 @@ device_register(struct device *dev, void *aux)
}
}
-struct nam2blk nam2blk[] = {
+const struct nam2blk nam2blk[] = {
{ "sd", 0 },
{ "vnd", 2 },
{ "cd", 3 },
diff --git a/sys/arch/octeon/octeon/conf.c b/sys/arch/octeon/octeon/conf.c
index d3dc9d1b88e..126723050c1 100644
--- a/sys/arch/octeon/octeon/conf.c
+++ b/sys/arch/octeon/octeon/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.27 2021/11/11 10:03:09 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.28 2022/09/02 20:06:56 miod Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -283,7 +283,7 @@ getnulldev()
}
-int chrtoblktbl[] = {
+const int chrtoblktbl[] = {
/* VCHR VBLK */
/* 0 */ NODEV,
/* 1 */ NODEV,
@@ -310,7 +310,7 @@ int chrtoblktbl[] = {
/* 22 */ 8 /* rd */
};
-int nchrtoblktbl = nitems(chrtoblktbl);
+const int nchrtoblktbl = nitems(chrtoblktbl);
#include <dev/cons.h>
diff --git a/sys/arch/powerpc64/powerpc64/autoconf.c b/sys/arch/powerpc64/powerpc64/autoconf.c
index ef8e29268f3..e6250ef365c 100644
--- a/sys/arch/powerpc64/powerpc64/autoconf.c
+++ b/sys/arch/powerpc64/powerpc64/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.7 2020/10/31 17:57:53 patrick Exp $ */
+/* $OpenBSD: autoconf.c,v 1.8 2022/09/02 20:06:56 miod Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
@@ -74,7 +74,7 @@ device_register(struct device *dev, void *aux)
{
}
-struct nam2blk nam2blk[] = {
+const struct nam2blk nam2blk[] = {
{ "vnd", 1 },
{ "rd", 2 },
{ "sd", 3 },
diff --git a/sys/arch/powerpc64/powerpc64/conf.c b/sys/arch/powerpc64/powerpc64/conf.c
index bda9235be25..429e34a8e08 100644
--- a/sys/arch/powerpc64/powerpc64/conf.c
+++ b/sys/arch/powerpc64/powerpc64/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.13 2021/11/11 10:03:09 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.14 2022/09/02 20:06:56 miod Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -233,7 +233,7 @@ getnulldev(void)
return makedev(mem_no, 2);
}
-int chrtoblktbl[] = {
+const int chrtoblktbl[] = {
/*VCHR*/ /*VBLK*/
/* 0 */ NODEV,
/* 1 */ NODEV,
@@ -264,4 +264,4 @@ int chrtoblktbl[] = {
/* 26 */ 3, /* sd */
/* 27 */ 4, /* cd */
};
-int nchrtoblktbl = nitems(chrtoblktbl);
+const int nchrtoblktbl = nitems(chrtoblktbl);
diff --git a/sys/arch/riscv64/riscv64/autoconf.c b/sys/arch/riscv64/riscv64/autoconf.c
index a447667bd51..16a522a64c2 100644
--- a/sys/arch/riscv64/riscv64/autoconf.c
+++ b/sys/arch/riscv64/riscv64/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.4 2021/05/14 06:48:52 jsg Exp $ */
+/* $OpenBSD: autoconf.c,v 1.5 2022/09/02 20:06:56 miod Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
@@ -97,7 +97,7 @@ device_register(struct device *dev, void *aux)
{
}
-struct nam2blk nam2blk[] = {
+const struct nam2blk nam2blk[] = {
{ "wd", 0 },
{ "sd", 4 },
{ "cd", 6 },
diff --git a/sys/arch/riscv64/riscv64/conf.c b/sys/arch/riscv64/riscv64/conf.c
index b21652f1fa9..5256251a3a3 100644
--- a/sys/arch/riscv64/riscv64/conf.c
+++ b/sys/arch/riscv64/riscv64/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.14 2022/02/18 10:51:43 visa Exp $ */
+/* $OpenBSD: conf.c,v 1.15 2022/09/02 20:06:56 miod Exp $ */
/*
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -267,7 +267,7 @@ getnulldev(void)
return makedev(mem_no, 2);
}
-int chrtoblktbl[] = {
+const int chrtoblktbl[] = {
/*VCHR*/ /*VBLK*/
/* 0 */ NODEV,
/* 1 */ NODEV,
@@ -319,7 +319,7 @@ int chrtoblktbl[] = {
/* 47 */ 8, /* rd */
};
-int nchrtoblktbl = nitems(chrtoblktbl);
+const int nchrtoblktbl = nitems(chrtoblktbl);
/*
* In order to map BSD bdev numbers of disks to their BIOS equivalents
diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c
index a828db2f853..079b7ce2152 100644
--- a/sys/arch/sparc64/sparc64/autoconf.c
+++ b/sys/arch/sparc64/sparc64/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.140 2021/10/24 17:05:04 mpi Exp $ */
+/* $OpenBSD: autoconf.c,v 1.141 2022/09/02 20:06:56 miod Exp $ */
/* $NetBSD: autoconf.c,v 1.51 2001/07/24 19:32:11 eeh Exp $ */
/*
@@ -1540,7 +1540,7 @@ nail_bootdev(struct device *dev, struct bootpath *bp)
bootpath_store(1, NULL);
}
-struct nam2blk nam2blk[] = {
+const struct nam2blk nam2blk[] = {
{ "rd", 5 },
{ "sd", 7 },
{ "vnd", 8 },
diff --git a/sys/arch/sparc64/sparc64/conf.c b/sys/arch/sparc64/sparc64/conf.c
index 9c5b692f24e..497db445498 100644
--- a/sys/arch/sparc64/sparc64/conf.c
+++ b/sys/arch/sparc64/sparc64/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.86 2021/11/11 10:03:09 claudio Exp $ */
+/* $OpenBSD: conf.c,v 1.87 2022/09/02 20:06:56 miod Exp $ */
/* $NetBSD: conf.c,v 1.17 2001/03/26 12:33:26 lukem Exp $ */
/*
@@ -340,7 +340,7 @@ getnulldev(void)
return makedev(mem_no, 2);
}
-int chrtoblktbl[] = {
+const int chrtoblktbl[] = {
/*VCHR*/ /*VBLK*/
/* 0 */ NODEV,
/* 1 */ NODEV,
@@ -454,4 +454,4 @@ int chrtoblktbl[] = {
/*109 */ NODEV,
/*110 */ 8, /* vnd */
};
-int nchrtoblktbl = nitems(chrtoblktbl);
+const int nchrtoblktbl = nitems(chrtoblktbl);
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index 483cd7cb95a..71eb77c0000 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.258 2022/09/02 14:18:47 krw Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.259 2022/09/02 20:06:56 miod Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -1664,7 +1664,7 @@ gotswap:
printf("\n");
}
-extern struct nam2blk nam2blk[];
+extern const struct nam2blk nam2blk[];
int
findblkmajor(struct device *dv)
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index a37af252fb7..73b7b14862b 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.h,v 1.158 2022/06/28 14:43:50 visa Exp $ */
+/* $OpenBSD: conf.h,v 1.159 2022/09/02 20:06:56 miod Exp $ */
/* $NetBSD: conf.h,v 1.33 1996/05/03 20:03:32 christos Exp $ */
/*-
@@ -531,8 +531,8 @@ struct swdevt {
#ifdef _KERNEL
extern struct swdevt swdevt[];
-extern int chrtoblktbl[];
-extern int nchrtoblktbl;
+extern const int chrtoblktbl[];
+extern const int nchrtoblktbl;
struct bdevsw *bdevsw_lookup(dev_t);
struct cdevsw *cdevsw_lookup(dev_t);