[PATCH] thermal: core: fix permissions and cleanup style

Mayur Kumar posted 1 patch 1 month ago
drivers/thermal/thermal_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] thermal: core: fix permissions and cleanup style
Posted by Mayur Kumar 1 month ago
Convert symbolic permissions to octal 0644 in thermal_core.c.
Also, re-align function parameters for for_each_thermal_* helpers
to match kernel coding style.

Note: checkpatch.pl reports an error regarding brace placement
on lines 707, 725, and 743, but these are false positives caused
by the complex function pointer arguments in the definitions.

Signed-off-by: Mayur Kumar <kmayur809@gmail.com>
---
 drivers/thermal/thermal_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 2f4e2dc46b8..c44bc084064 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -877,7 +877,7 @@ static int thermal_bind_cdev_to_trip(struct thermal_zone_device *tz,
 		 "cdev%d_weight", dev->id);
 	sysfs_attr_init(&dev->weight_attr.attr);
 	dev->weight_attr.attr.name = dev->weight_attr_name;
-	dev->weight_attr.attr.mode = S_IWUSR | S_IRUGO;
+	dev->weight_attr.attr.mode = 0644;
 	dev->weight_attr.show = weight_show;
 	dev->weight_attr.store = weight_store;
 	result = device_create_file(&tz->device, &dev->weight_attr);
-- 
2.34.1
Re: [PATCH] thermal: core: fix permissions and cleanup style
Posted by Rafael J. Wysocki 1 month ago
On Mon, May 11, 2026 at 7:34 PM Mayur Kumar <kmayur809@gmail.com> wrote:
>
> Convert symbolic permissions to octal 0644 in thermal_core.c.
> Also, re-align function parameters for for_each_thermal_* helpers
> to match kernel coding style.

checkpatch.pl is for new code.

Generally speaking, existing code that works need not be "fixed" to
address checkpatch warnings in it.

I'm not going to make this particular change.

> Note: checkpatch.pl reports an error regarding brace placement
> on lines 707, 725, and 743, but these are false positives caused
> by the complex function pointer arguments in the definitions.
>
> Signed-off-by: Mayur Kumar <kmayur809@gmail.com>
> ---
>  drivers/thermal/thermal_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 2f4e2dc46b8..c44bc084064 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -877,7 +877,7 @@ static int thermal_bind_cdev_to_trip(struct thermal_zone_device *tz,
>                  "cdev%d_weight", dev->id);
>         sysfs_attr_init(&dev->weight_attr.attr);
>         dev->weight_attr.attr.name = dev->weight_attr_name;
> -       dev->weight_attr.attr.mode = S_IWUSR | S_IRUGO;
> +       dev->weight_attr.attr.mode = 0644;
>         dev->weight_attr.show = weight_show;
>         dev->weight_attr.store = weight_store;
>         result = device_create_file(&tz->device, &dev->weight_attr);
> --
> 2.34.1
>