Author: kevans
Date: Sun Dec 22 16:57:19 2019
New Revision: 356008
URL: https://svnweb.freebsd.org/changeset/base/356008

Log:
  MFC r355842: kbd: const'ify a couple of keyboard_driver fields

Modified:
  stable/12/sys/dev/kbd/kbdreg.h
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/dev/kbd/kbdreg.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/sys/dev/kbd/kbdreg.h
==============================================================================
--- stable/12/sys/dev/kbd/kbdreg.h      Sun Dec 22 16:04:12 2019        
(r356007)
+++ stable/12/sys/dev/kbd/kbdreg.h      Sun Dec 22 16:57:19 2019        
(r356008)
@@ -207,12 +207,17 @@ typedef struct keyboard_switch {
 #define kbdd_diag(kbd, level)                                          \
        (*kbdsw[(kbd)->kb_index]->diag)((kbd), (leve))
 
-/* keyboard driver */
+/*
+ * Keyboard driver definition.  Some of these be immutable after definition
+ * time, e.g. one shouldn't be able to rename a driver or use a different kbdsw
+ * entirely, but patching individual methods is acceptable.
+ */
 typedef struct keyboard_driver {
     SLIST_ENTRY(keyboard_driver) link;
-    char               *name;
-    keyboard_switch_t  *kbdsw;
-    int                        (*configure)(int); /* backdoor for the console 
driver */
+    const char * const         name;
+    keyboard_switch_t * const  kbdsw;
+    /* backdoor for the console driver */
+    int                                (* const configure)(int);
 } keyboard_driver_t;
 
 #ifdef _KERNEL
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to