kbd: const'ify a couple of keyboard_driver fields

Nothing modifies these things, but const'ify out of an abundance of caution.
If we could const'ify the definition in each keyboard driver, I likely
would- improper mutations here can lead to misbehavior or slightly more
annoying to debug state.
This commit is contained in:
Kyle Evans 2019-12-17 03:30:49 +00:00
parent fa9b4635f0
commit 7987629081
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=355842

View File

@ -96,12 +96,17 @@ typedef struct keyboard_switch {
kbd_diag_t *diag;
} keyboard_switch_t;
/* 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;
/* keyboard */