diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2024-01-05 16:45:11 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-01-12 17:38:23 +0300 |
commit | 57a427c81c322c5f0cdfe7c46cdee553d18b1ec6 (patch) | |
tree | 88d3197697a363d90f266346802eaf0778660fda /include/linux/thermal.h | |
parent | 7ef01f228c9f54c6260319858be138a8a7e9e704 (diff) | |
download | linux-57a427c81c322c5f0cdfe7c46cdee553d18b1ec6.tar.xz |
thermal: core: Use kstrdup_const() during cooling device registration
Some *thermal_cooling_device_register() calls pass a string literal as
the 'type' parameter, so kstrdup_const() can be used instead of
kstrdup() to avoid a memory allocation in such cases.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r-- | include/linux/thermal.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 7defea8fa223..3227335fb447 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -103,7 +103,7 @@ struct thermal_cooling_device_ops { struct thermal_cooling_device { int id; - char *type; + const char *type; unsigned long max_state; struct device device; struct device_node *np; |