Skip to content

Commit 323803a

Browse files
committed
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 parent daae9c1 commit 323803a

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

drivers/thermal/thermal_core.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -695,18 +695,12 @@ int thermal_zone_device_disable(struct thermal_zone_device *tz)
695695
}
696696
EXPORT_SYMBOL_GPL(thermal_zone_device_disable);
697697

698-
static bool thermal_zone_is_present(struct thermal_zone_device *tz)
699-
{
700-
return !list_empty(&tz->node);
701-
}
702-
703698
void thermal_zone_device_update(struct thermal_zone_device *tz,
704699
enum thermal_notify_event event)
705700
{
706701
guard(thermal_zone)(tz);
707702

708-
if (thermal_zone_is_present(tz))
709-
__thermal_zone_device_update(tz, event);
703+
__thermal_zone_device_update(tz, event);
710704
}
711705
EXPORT_SYMBOL_GPL(thermal_zone_device_update);
712706

0 commit comments

Comments
 (0)