Skip to content

Commit

Permalink
cpufreq: Remove cpufreq_driver check in cpufreq_boost_supported()
Browse files Browse the repository at this point in the history
Currently there are three calling paths for cpufreq_boost_supported() in
all as below, we can see the cpufreq_driver null check is needless since
it is already checked before.

<path1>
  cpufreq_enable_boost_support()
    |-> if (!cpufreq_driver)
    |-> cpufreq_boost_supported()

<path2>
  cpufreq_register_driver()
    |-> if (!driver_data ...
    |-> cpufreq_driver = driver_data
    |-> cpufreq_boost_supported()
    |-> remove_boost_sysfs_file()
          |-> cpufreq_boost_supported()

<path3>
  cpufreq_unregister_driver()
    |-> if (!cpufreq_driver ...
    |-> remove_boost_sysfs_file()
          |-> cpufreq_boost_supported()

Signed-off-by: Yue Hu <huyue2@yulong.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Yue Hu authored and Rafael J. Wysocki committed Apr 9, 2019
1 parent e75135e commit 89f98d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -2472,7 +2472,7 @@ int cpufreq_boost_trigger_state(int state)

static bool cpufreq_boost_supported(void)
{
return likely(cpufreq_driver) && cpufreq_driver->set_boost;
return cpufreq_driver->set_boost;
}

static int create_boost_sysfs_file(void)
Expand Down

0 comments on commit 89f98d7

Please sign in to comment.