* [PATCH 11/31] cpufreq/sfi: use kmemdup rather than duplicating its implementation
[not found] <1438934377-4922-1-git-send-email-a.hajda@samsung.com>
@ 2015-08-07 7:59 ` Andrzej Hajda
2015-08-07 8:58 ` Viresh Kumar
0 siblings, 1 reply; 2+ messages in thread
From: Andrzej Hajda @ 2015-08-07 7:59 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar
Cc: Andrzej Hajda, Bartlomiej Zolnierkiewicz, Marek Szyprowski,
linux-kernel, linux-pm
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>
---
drivers/cpufreq/sfi-cpufreq.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/cpufreq/sfi-cpufreq.c b/drivers/cpufreq/sfi-cpufreq.c
index ffa3389..992ce6f 100644
--- a/drivers/cpufreq/sfi-cpufreq.c
+++ b/drivers/cpufreq/sfi-cpufreq.c
@@ -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;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 11/31] cpufreq/sfi: use kmemdup rather than duplicating its implementation
2015-08-07 7:59 ` [PATCH 11/31] cpufreq/sfi: use kmemdup rather than duplicating its implementation Andrzej Hajda
@ 2015-08-07 8:58 ` Viresh Kumar
0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2015-08-07 8:58 UTC (permalink / raw)
To: Andrzej Hajda
Cc: Rafael J. Wysocki, Bartlomiej Zolnierkiewicz, Marek Szyprowski,
linux-kernel, linux-pm
On 07-08-15, 09:59, Andrzej Hajda wrote:
> 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>
> ---
> drivers/cpufreq/sfi-cpufreq.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/cpufreq/sfi-cpufreq.c b/drivers/cpufreq/sfi-cpufreq.c
> index ffa3389..992ce6f 100644
> --- a/drivers/cpufreq/sfi-cpufreq.c
> +++ b/drivers/cpufreq/sfi-cpufreq.c
> @@ -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);
> -
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
viresh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-07 8:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1438934377-4922-1-git-send-email-a.hajda@samsung.com>
2015-08-07 7:59 ` [PATCH 11/31] cpufreq/sfi: use kmemdup rather than duplicating its implementation Andrzej Hajda
2015-08-07 8:58 ` Viresh Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).