Re: [PATCH v3 2/2] thermal: add a virtual sensor to aggregate temperatures

From: kernel test robot
Date: Mon Nov 08 2021 - 21:33:32 EST


Hi Alexandre,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on rafael-pm/thermal]
[also build test WARNING on v5.15 next-20211108]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Alexandre-Bailon/Add-a-generic-virtual-thermal-sensor/20211029-231137
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal
config: i386-allmodconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/be0e058f9a82f32140e4e96cf67a3e0842da9f70
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alexandre-Bailon/Add-a-generic-virtual-thermal-sensor/20211029-231137
git checkout be0e058f9a82f32140e4e96cf67a3e0842da9f70
# save the attached .config to linux build tree
make W=1 ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> drivers/thermal/virtual_thermal_sensor.c:73:5: warning: no previous prototype for 'virtual_thermal_sensor_get_module' [-Wmissing-prototypes]
73 | int virtual_thermal_sensor_get_module(struct virtual_thermal_zone_device *zone,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/thermal/virtual_thermal_sensor.c:102:6: warning: no previous prototype for 'virtual_thermal_sensor_put_modules' [-Wmissing-prototypes]
102 | void virtual_thermal_sensor_put_modules(struct virtual_thermal_sensor *sensor)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/virtual_thermal_sensor_get_module +73 drivers/thermal/virtual_thermal_sensor.c

72
> 73 int virtual_thermal_sensor_get_module(struct virtual_thermal_zone_device *zone,
74 const char *name)
75 {
76 struct platform_device *sensor_pdev;
77 struct device_node *node;
78
79 node = of_find_node_by_name(NULL, name);
80 if (!node)
81 return -ENODEV;
82
83 node = of_parse_phandle(node, "thermal-sensors", 0);
84 if (!node)
85 return -ENODEV;
86
87 sensor_pdev = of_find_device_by_node(node);
88 if (!sensor_pdev)
89 return -ENODEV;
90
91 if (!sensor_pdev->dev.driver)
92 return -EPROBE_DEFER;
93
94 if (!try_module_get(sensor_pdev->dev.driver->owner))
95 return -ENODEV;
96
97 zone->owner = sensor_pdev->dev.driver->owner;
98
99 return 0;
100 }
101
> 102 void virtual_thermal_sensor_put_modules(struct virtual_thermal_sensor *sensor)
103 {
104 int i;
105
106 for (i = 0; i < sensor->count; i++) {
107 if (sensor->zones[i].zone)
108 module_put(sensor->zones[i].owner);
109 }
110 }
111

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip