Skip to content

Commit

Permalink
arch/x86/intel-mid: Use kmemdup rather than duplicating its implement…
Browse files Browse the repository at this point in the history
…ation

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>
  • Loading branch information
Andrzej Hajda authored and Thomas Gleixner committed Sep 17, 2015
1 parent d0a9964 commit c9e69c8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/x86/platform/intel-mid/sfi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
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)
return -1;
memcpy(gpio_table, pentry, num * sizeof(*pentry));
gpio_num_entry = num;

pr_debug("GPIO pin info:\n");
Expand Down

0 comments on commit c9e69c8

Please sign in to comment.