提交 c9e69c8c 编写于 作者: A Andrzej Hajda 提交者: Thomas Gleixner

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/2014320Signed-off-by: NAndrzej 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.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 d0a9964e
...@@ -197,10 +197,9 @@ static int __init sfi_parse_gpio(struct sfi_table_header *table) ...@@ -197,10 +197,9 @@ static int __init sfi_parse_gpio(struct sfi_table_header *table)
num = SFI_GET_NUM_ENTRIES(sb, struct sfi_gpio_table_entry); num = SFI_GET_NUM_ENTRIES(sb, struct sfi_gpio_table_entry);
pentry = (struct sfi_gpio_table_entry *)sb->pentry; pentry = (struct sfi_gpio_table_entry *)sb->pentry;
gpio_table = kmalloc(num * sizeof(*pentry), GFP_KERNEL); gpio_table = kmemdup(pentry, num * sizeof(*pentry), GFP_KERNEL);
if (!gpio_table) if (!gpio_table)
return -1; return -1;
memcpy(gpio_table, pentry, num * sizeof(*pentry));
gpio_num_entry = num; gpio_num_entry = num;
pr_debug("GPIO pin info:\n"); pr_debug("GPIO pin info:\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册