Skip to content

Commit d1dd75c

Browse files
Binary-EaterBenjamin Tissoires
authored andcommitted
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>
1 parent 4c2c5ff commit d1dd75c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/linux/hid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ struct hid_usage_id {
816816
* zero from them.
817817
*/
818818
struct hid_driver {
819-
char *name;
819+
const char *name;
820820
const struct hid_device_id *id_table;
821821

822822
struct list_head dyn_list;

0 commit comments

Comments
 (0)