diff options
| author | Rahul Rameshbabu <sergeantsagara@protonmail.com> | 2025-09-13 16:12:54 +0000 |
|---|---|---|
| committer | Benjamin Tissoires <bentiss@kernel.org> | 2025-09-17 11:48:01 +0200 |
| commit | d1dd75c6500c74b91c5286fd3277710371d3e3ca (patch) | |
| tree | 3b298f5ca17f03a537d1bc671ba8cf46689e6305 /include/linux | |
| parent | 4c2c5ff9f3d72fb41f884f7c493ae9df83379340 (diff) | |
HID: core: Change hid_driver to use a const char* for name
name is never mutated by the core HID stack. Making name a const char*
simplifies passing the string from Rust to C. Otherwise, it becomes
difficult to pass a 'static lifetime CStr from Rust to a char*, rather than
a const char*, due to lack of guarantee that the underlying data of the
CStr will not be mutated by the C code.
Signed-off-by: Rahul Rameshbabu <sergeantsagara@protonmail.com>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/hid.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index 2cc4f1e4ea96..426b22ed42b4 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -816,7 +816,7 @@ struct hid_usage_id { * zero from them. */ struct hid_driver { - char *name; + const char *name; const struct hid_device_id *id_table; struct list_head dyn_list; |
