From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752500AbbIQVmz (ORCPT ); Thu, 17 Sep 2015 17:42:55 -0400 Received: from terminus.zytor.com ([198.137.202.10]:39088 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752177AbbIQVmy (ORCPT ); Thu, 17 Sep 2015 17:42:54 -0400 Date: Thu, 17 Sep 2015 14:42:31 -0700 From: tip-bot for Andrzej Hajda Message-ID: Cc: m.szyprowski@samsung.com, Julia.Lawall@lip6.fr, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de, a.hajda@samsung.com, b.zolnierkie@samsung.com, linux-kernel@vger.kernel.org Reply-To: mingo@kernel.org, hpa@zytor.com, Julia.Lawall@lip6.fr, m.szyprowski@samsung.com, linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com, a.hajda@samsung.com, tglx@linutronix.de In-Reply-To: <1438934377-4922-9-git-send-email-a.hajda@samsung.com> References: <1438934377-4922-9-git-send-email-a.hajda@samsung.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/platform] arch/x86/intel-mid: Use kmemdup rather than duplicating its implementation Git-Commit-ID: c9e69c8c58eb8671e9f6cee728088e4c5abc9115 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: c9e69c8c58eb8671e9f6cee728088e4c5abc9115 Gitweb: http://git.kernel.org/tip/c9e69c8c58eb8671e9f6cee728088e4c5abc9115 Author: Andrzej Hajda AuthorDate: Fri, 7 Aug 2015 09:59:14 +0200 Committer: Thomas Gleixner CommitDate: Thu, 17 Sep 2015 23:38:59 +0200 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 Cc: Bartlomiej Zolnierkiewicz Cc: Marek Szyprowski Cc: Julia Lawall Link: http://lkml.kernel.org/r/1438934377-4922-9-git-send-email-a.hajda@samsung.com Signed-off-by: Thomas Gleixner --- arch/x86/platform/intel-mid/sfi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/platform/intel-mid/sfi.c b/arch/x86/platform/intel-mid/sfi.c index ce992e8..5ee360a 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) 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");