Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

thermal: core: Drop redundant check from thermal_zone_device_update()

Since __thermal_zone_device_update() checks if tz->state is
TZ_STATE_READY and bails out immediately otherwise, it is not
necessary to check the thermal_zone_is_present() return value in
thermal_zone_device_update(). Namely, tz->state is equal to
TZ_STATE_FLAG_INIT initially and that flag is only cleared in
thermal_zone_init_complete() after adding tz to the list of thermal
zones, and thermal_zone_exit() sets TZ_STATE_FLAG_EXIT in tz->state
while removing tz from that list. Thus tz->state is not TZ_STATE_READY
when tz is not in the list and the check mentioned above is redundant.

Accordingly, drop the redundant thermal_zone_is_present() check from
thermal_zone_device_update() and drop the former altogether because it
has no more users.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/3406806.aeNJFYEL58@rafael.j.wysocki

+1 -7
+1 -7
drivers/thermal/thermal_core.c
··· 695 695 } 696 696 EXPORT_SYMBOL_GPL(thermal_zone_device_disable); 697 697 698 - static bool thermal_zone_is_present(struct thermal_zone_device *tz) 699 - { 700 - return !list_empty(&tz->node); 701 - } 702 - 703 698 void thermal_zone_device_update(struct thermal_zone_device *tz, 704 699 enum thermal_notify_event event) 705 700 { 706 701 guard(thermal_zone)(tz); 707 702 708 - if (thermal_zone_is_present(tz)) 709 - __thermal_zone_device_update(tz, event); 703 + __thermal_zone_device_update(tz, event); 710 704 } 711 705 EXPORT_SYMBOL_GPL(thermal_zone_device_update); 712 706