From: Rafael J. Wysocki Date: Wed, 31 Aug 2016 01:11:31 +0000 (+0200) Subject: cpufreq: Drop unnecessary check from cpufreq_policy_alloc() X-Git-Tag: v4.9-rc1~171^2~2^2~13^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3689ad7ed6a836c4eec5e7bdd17a11a79591bef9;p=karo-tx-linux.git cpufreq: Drop unnecessary check from cpufreq_policy_alloc() Since cpufreq_policy_alloc() doesn't use its dev variable for anything useful, drop that variable from there along with the NULL check against it. Signed-off-by: Rafael J. Wysocki Acked-by: Viresh Kumar --- diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 3dd4884c6f9e..13fb589b6d2c 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1073,13 +1073,9 @@ static void handle_update(struct work_struct *work) static struct cpufreq_policy *cpufreq_policy_alloc(unsigned int cpu) { - struct device *dev = get_cpu_device(cpu); struct cpufreq_policy *policy; int ret; - if (WARN_ON(!dev)) - return NULL; - policy = kzalloc(sizeof(*policy), GFP_KERNEL); if (!policy) return NULL;