summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/subr_kobj.c2
-rw-r--r--sys/sys/kobj.h2
-rw-r--r--sys/tools/makeobjops.awk2
3 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/subr_kobj.c b/sys/kern/subr_kobj.c
index 4ee7182..23ad29f 100644
--- a/sys/kern/subr_kobj.c
+++ b/sys/kern/subr_kobj.c
@@ -92,7 +92,7 @@ SYSINIT(kobj, SI_SUB_LOCK, SI_ORDER_ANY, kobj_init_mutex, NULL);
* desc pointer is NULL, it is guaranteed never to match any read
* descriptors.
*/
-static struct kobj_method null_method = {
+static const struct kobj_method null_method = {
0, 0,
};
diff --git a/sys/sys/kobj.h b/sys/sys/kobj.h
index 3143bea..31d308a 100644
--- a/sys/sys/kobj.h
+++ b/sys/sys/kobj.h
@@ -34,7 +34,7 @@
*/
typedef struct kobj *kobj_t;
typedef struct kobj_class *kobj_class_t;
-typedef struct kobj_method kobj_method_t;
+typedef const struct kobj_method kobj_method_t;
typedef int (*kobjop_t)(void);
typedef struct kobj_ops *kobj_ops_t;
typedef struct kobjop_desc *kobjop_desc_t;
diff --git a/sys/tools/makeobjops.awk b/sys/tools/makeobjops.awk
index 0406b85..4e3bd04 100644
--- a/sys/tools/makeobjops.awk
+++ b/sys/tools/makeobjops.awk
@@ -307,7 +307,7 @@ function handle_method (static, doc)
line_width, length(prototype)));
# Print out the method desc
- printc("struct kobj_method " mname "_method_default = {");
+ printc("static const struct kobj_method " mname "_method_default = {");
printc("\t&" mname "_desc, (kobjop_t) " default_function);
printc("};\n");
OpenPOWER on IntegriCloud