diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2015-08-07 03:59:14 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-09-17 17:38:59 -0400 |
commit | c9e69c8c58eb8671e9f6cee728088e4c5abc9115 (patch) | |
tree | 4a5ec663a274261c4cabaccf16bb67f2aaf06e36 | |
parent | d0a9964e98731c708500a2e712f28f9d39183647 (diff) |
arch/x86/intel-mid: Use kmemdup rather than duplicating its implementation
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>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>
Link: http://lkml.kernel.org/r/1438934377-4922-9-git-send-email-a.hajda@samsung.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/platform/intel-mid/sfi.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/platform/intel-mid/sfi.c b/arch/x86/platform/intel-mid/sfi.c index ce992e8cc065..5ee360a951ce 100644 --- a/arch/x86/platform/intel-mid/sfi.c +++ b/arch/x86/platform/intel-mid/sfi.c | |||
@@ -197,10 +197,9 @@ static int __init sfi_parse_gpio(struct sfi_table_header *table) | |||
197 | num = SFI_GET_NUM_ENTRIES(sb, struct sfi_gpio_table_entry); | 197 | num = SFI_GET_NUM_ENTRIES(sb, struct sfi_gpio_table_entry); |
198 | pentry = (struct sfi_gpio_table_entry *)sb->pentry; | 198 | pentry = (struct sfi_gpio_table_entry *)sb->pentry; |
199 | 199 | ||
200 | gpio_table = kmalloc(num * sizeof(*pentry), GFP_KERNEL); | 200 | gpio_table = kmemdup(pentry, num * sizeof(*pentry), GFP_KERNEL); |
201 | if (!gpio_table) | 201 | if (!gpio_table) |
202 | return -1; | 202 | return -1; |
203 | memcpy(gpio_table, pentry, num * sizeof(*pentry)); | ||
204 | gpio_num_entry = num; | 203 | gpio_num_entry = num; |
205 | 204 | ||
206 | pr_debug("GPIO pin info:\n"); | 205 | pr_debug("GPIO pin info:\n"); |