Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755615AbbHGIAe (ORCPT ); Fri, 7 Aug 2015 04:00:34 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:25459 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755311AbbHGIA0 (ORCPT ); Fri, 7 Aug 2015 04:00:26 -0400 X-AuditID: cbfec7f5-f794b6d000001495-cc-55c4659890aa From: Andrzej Hajda To: Geert Uytterhoeven Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , linux-kernel@vger.kernel.org, linux-m68k@vger.kernel.org Subject: [PATCH 03/31] arch/m68k/bootinfo: use kmemdup rather than duplicating its implementation Date: Fri, 07 Aug 2015 09:59:09 +0200 Message-id: <1438934377-4922-4-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1438934377-4922-1-git-send-email-a.hajda@samsung.com> References: <1438934377-4922-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupiluLIzCtJLcpLzFFi42I5/e/4Fd0ZqUdCDRbNYrW4te4cq8XGGetZ LZ7d2stkcXnXHDaL5U/WMlusPXKX3YHN49DhDkaPk63fWDz6tqxi9Pi8SS6AJYrLJiU1J7Ms tUjfLoEro+PsFvaCa+wVl7dfZ29gPMbWxcjJISFgIrG59xkLhC0mceHeeqA4F4eQwFJGib9z D7BCOE1MEq8WXWECqWIT0JT4u/kmUBUHh4iArsScn0wgNcwC5xkluj/cYgepERZIlng8bTKY zSKgKrH5xFGwDbwCThIPp2xjhtgmJ3Hy2GRWEJtTwFliZfdMMFsIqOZN3wXmCYy8CxgZVjGK ppYmFxQnpeca6RUn5haX5qXrJefnbmKEhNDXHYxLj1kdYhTgYFTi4U34dzhUiDWxrLgy9xCj BAezkgjvQ32gEG9KYmVValF+fFFpTmrxIUZpDhYlcd6Zu96HCAmkJ5akZqemFqQWwWSZODil Ghjl9uR4lfy6OefIGhemf0vEDh0MbS/1aL0xl33Px1W94TMW8UiK57/db9G6S1T88lOxJTH/ RWfsyLna2hgd8E3dOTP3b3mk1pHHXxyUzAqv5Ivt3XTK6POTr1Y2aXPLJukd3r5074oe7yse VRyf9696zRggFbT3srm3oFlN1DVPhSMcqmYT4gKVWIozEg21mIuKEwHqEys4HQIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1196 Lines: 36 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 --- arch/m68k/kernel/bootinfo_proc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/m68k/kernel/bootinfo_proc.c b/arch/m68k/kernel/bootinfo_proc.c index 7ee853e..2a33a96 100644 --- a/arch/m68k/kernel/bootinfo_proc.c +++ b/arch/m68k/kernel/bootinfo_proc.c @@ -62,12 +62,10 @@ static int __init init_bootinfo_procfs(void) if (!bootinfo_size) return -EINVAL; - bootinfo_copy = kmalloc(bootinfo_size, GFP_KERNEL); + bootinfo_copy = kmemdup(bootinfo_tmp, bootinfo_size, GFP_KERNEL); if (!bootinfo_copy) return -ENOMEM; - memcpy(bootinfo_copy, bootinfo_tmp, bootinfo_size); - pde = proc_create_data("bootinfo", 0400, NULL, &bootinfo_fops, NULL); if (!pde) { kfree(bootinfo_copy); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/