Message ID | 20240130111250.185718-2-angelogioacchino.delregno@collabora.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | Thermal: Part 1 - Introduce new structs and registration | expand |
On Tue, Jan 30, 2024 at 12:13 PM AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> wrote: > > All users are already assigning a const char * to the `governor_name` > member of struct thermal_zone_params and to the `name` member of > struct thermal_governor. > Even if users are technically wrong, it just makes more sense to change > this member to be a const char pointer instead of doing the other way > around. > > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Acked-by: Rafael J. Wysocki <rafael@kernel.org> or I can pick it up right away if you want me to do that. > --- > include/linux/thermal.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/thermal.h b/include/linux/thermal.h > index b7a3deb372fd..65d8f92a9a0d 100644 > --- a/include/linux/thermal.h > +++ b/include/linux/thermal.h > @@ -214,7 +214,7 @@ struct thermal_zone_device { > * @governor_list: node in thermal_governor_list (in thermal_core.c) > */ > struct thermal_governor { > - char name[THERMAL_NAME_LENGTH]; > + const char *name; > int (*bind_to_tz)(struct thermal_zone_device *tz); > void (*unbind_from_tz)(struct thermal_zone_device *tz); > int (*throttle)(struct thermal_zone_device *tz, > @@ -226,7 +226,7 @@ struct thermal_governor { > > /* Structure to define Thermal Zone parameters */ > struct thermal_zone_params { > - char governor_name[THERMAL_NAME_LENGTH]; > + const char *governor_name; > > /* > * a boolean to indicate if the thermal to hwmon sysfs interface > --
Il 01/02/24 19:37, Rafael J. Wysocki ha scritto: > On Tue, Jan 30, 2024 at 12:13 PM AngeloGioacchino Del Regno > <angelogioacchino.delregno@collabora.com> wrote: >> >> All users are already assigning a const char * to the `governor_name` >> member of struct thermal_zone_params and to the `name` member of >> struct thermal_governor. >> Even if users are technically wrong, it just makes more sense to change >> this member to be a const char pointer instead of doing the other way >> around. >> >> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> > > Acked-by: Rafael J. Wysocki <rafael@kernel.org> > > or I can pick it up right away if you want me to do that. > I appreciate having less patches to carry over with new series versions. Whatever you can take, please feel free to pick directly :-) Thanks, Angelo >> --- >> include/linux/thermal.h | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/include/linux/thermal.h b/include/linux/thermal.h >> index b7a3deb372fd..65d8f92a9a0d 100644 >> --- a/include/linux/thermal.h >> +++ b/include/linux/thermal.h >> @@ -214,7 +214,7 @@ struct thermal_zone_device { >> * @governor_list: node in thermal_governor_list (in thermal_core.c) >> */ >> struct thermal_governor { >> - char name[THERMAL_NAME_LENGTH]; >> + const char *name; >> int (*bind_to_tz)(struct thermal_zone_device *tz); >> void (*unbind_from_tz)(struct thermal_zone_device *tz); >> int (*throttle)(struct thermal_zone_device *tz, >> @@ -226,7 +226,7 @@ struct thermal_governor { >> >> /* Structure to define Thermal Zone parameters */ >> struct thermal_zone_params { >> - char governor_name[THERMAL_NAME_LENGTH]; >> + const char *governor_name; >> >> /* >> * a boolean to indicate if the thermal to hwmon sysfs interface >> --
On Fri, Feb 2, 2024 at 11:01 AM AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> wrote: > > Il 01/02/24 19:37, Rafael J. Wysocki ha scritto: > > On Tue, Jan 30, 2024 at 12:13 PM AngeloGioacchino Del Regno > > <angelogioacchino.delregno@collabora.com> wrote: > >> > >> All users are already assigning a const char * to the `governor_name` > >> member of struct thermal_zone_params and to the `name` member of > >> struct thermal_governor. > >> Even if users are technically wrong, it just makes more sense to change > >> this member to be a const char pointer instead of doing the other way > >> around. > >> > >> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> > > > > Acked-by: Rafael J. Wysocki <rafael@kernel.org> > > > > or I can pick it up right away if you want me to do that. > > > > I appreciate having less patches to carry over with new series versions. > > Whatever you can take, please feel free to pick directly :-) OK, applied (as 6.9 material). Thanks!
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index b7a3deb372fd..65d8f92a9a0d 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -214,7 +214,7 @@ struct thermal_zone_device { * @governor_list: node in thermal_governor_list (in thermal_core.c) */ struct thermal_governor { - char name[THERMAL_NAME_LENGTH]; + const char *name; int (*bind_to_tz)(struct thermal_zone_device *tz); void (*unbind_from_tz)(struct thermal_zone_device *tz); int (*throttle)(struct thermal_zone_device *tz, @@ -226,7 +226,7 @@ struct thermal_governor { /* Structure to define Thermal Zone parameters */ struct thermal_zone_params { - char governor_name[THERMAL_NAME_LENGTH]; + const char *governor_name; /* * a boolean to indicate if the thermal to hwmon sysfs interface
All users are already assigning a const char * to the `governor_name` member of struct thermal_zone_params and to the `name` member of struct thermal_governor. Even if users are technically wrong, it just makes more sense to change this member to be a const char pointer instead of doing the other way around. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> --- include/linux/thermal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)