Skip to content

Commit

Permalink
cpufreq: sfi: use kmemdup rather than duplicating its implementation
Browse files Browse the repository at this point in the history
The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Andrzej Hajda authored and Rafael J. Wysocki committed Sep 1, 2015
1 parent 36dfef2 commit a482e55
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/cpufreq/sfi-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@ static int sfi_parse_freq(struct sfi_table_header *table)
pentry = (struct sfi_freq_table_entry *)sb->pentry;
totallen = num_freq_table_entries * sizeof(*pentry);

sfi_cpufreq_array = kzalloc(totallen, GFP_KERNEL);
sfi_cpufreq_array = kmemdup(pentry, totallen, GFP_KERNEL);
if (!sfi_cpufreq_array)
return -ENOMEM;

memcpy(sfi_cpufreq_array, pentry, totallen);

return 0;
}

Expand Down

0 comments on commit a482e55

Please sign in to comment.