Hello Michael, thanks much for your feedback.
I've changed my copy to: if (path == NULL) { if (thermal_zone == NULL) { if (path == NULL) asprintf(&thermal_zone, THERMAL_ZONE, zone); else asprintf(&thermal_zone, path, zone); } path = thermal_zone; } as I provide the full paths to the sensor outputs in my config file. But before I submit a patch, I wanted to ask whether this still catches the intention of this method?
I think your code will actually not work properly either, because thermal_zone is a static variable. I think you’ll need to kill that variable entirely to make multiple instances of the cpu_temperature module work.
The temperatures are correctly displayed for me. With my configuration, 'path' should never be NULL and therefore 'thermal_zone' never actually used.
But yes, I would question the use of the static variable entirely. It's not clear to me what the intention here is. Thanks.
Cheers, Marco