From patchwork Fri Aug 7 07:59:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 6966141 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 68EB49F373 for ; Fri, 7 Aug 2015 08:03:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7FA4320497 for ; Fri, 7 Aug 2015 08:03:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A50912041D for ; Fri, 7 Aug 2015 08:03:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZNcae-0005hs-Pz; Fri, 07 Aug 2015 08:01:20 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZNcaR-0005Xc-2G for linux-arm-kernel@lists.infradead.org; Fri, 07 Aug 2015 08:01:07 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NSP00E6DCWKC740@mailout3.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 07 Aug 2015 09:00:20 +0100 (BST) X-AuditID: cbfec7f4-f79c56d0000012ee-33-55c465942dbc Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 03.84.04846.49564C55; Fri, 7 Aug 2015 09:00:20 +0100 (BST) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NSP0013BCW67E10@eusync2.samsung.com>; Fri, 07 Aug 2015 09:00:20 +0100 (BST) From: Andrzej Hajda To: Roland Stigge Subject: [PATCH 01/31] arch/arm/mach-lpc32xx: use kmemdup rather than duplicating its implementation Date: Fri, 07 Aug 2015 09:59:07 +0200 Message-id: <1438934377-4922-2-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+NgFupgluLIzCtJLcpLzFFi42I5/e/4Fd0pqUdCDfrey1ncWneO1WLjjPWs FpseX2O1uLxrDpvF2iN32S0mLznL6sDmMWfqbkaPzUvqPfq2rGL0+LxJLoAlissmJTUnsyy1 SN8ugStjwmaNgplcFX9/X2NtYNzE0cXIySEhYCJxaO0uJghbTOLCvfVsXYxcHEICSxklnj16 zA7hNDFJzNrUxA5SxSagKfF38002EFtEQEWi9etUVpAiZoErjBJz3r4Acjg4hAXSJF4tMwSp YRFQldj3fS0ziM0r4CTxoHc+M8Q2OYmTxyazgticAs4SK7tngtlCQDVv+i4wT2DkXcDIsIpR NLU0uaA4KT3XUK84Mbe4NC9dLzk/dxMjJHy+7GBcfMzqEKMAB6MSD2/Cv8OhQqyJZcWVuYcY JTiYlUR4H+oDhXhTEiurUovy44tKc1KLDzFKc7AoifPO3fU+REggPbEkNTs1tSC1CCbLxMEp 1cCo+mXHhBqx62dcJj484nhcVfJrLNtWHr/bO3aknDS5UODclVzIm7/o8vGkD7z+CvPvhOWL 1NcnraryypEtDLwyv/adc8xSFt+Ymcm84R2LTvNy8e9kmB6p0SlVs1L0YLjlhTmBvBnSvjrv 7ET5TGvZd0edPO/YpH3eofnafq4eRfOV3P+fiyixFGckGmoxFxUnAgAXj9AxGwIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150807_010107_254963_F03C6F6C X-CRM114-Status: GOOD ( 12.92 ) X-Spam-Score: -7.0 (-------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrzej Hajda , Marek Szyprowski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartlomiej Zolnierkiewicz MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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/arm/mach-lpc32xx/pm.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-lpc32xx/pm.c b/arch/arm/mach-lpc32xx/pm.c index 207e812..dd3a432 100644 --- a/arch/arm/mach-lpc32xx/pm.c +++ b/arch/arm/mach-lpc32xx/pm.c @@ -87,7 +87,8 @@ static int lpc32xx_pm_enter(suspend_state_t state) void *iram_swap_area; /* Allocate some space for temporary IRAM storage */ - iram_swap_area = kmalloc(lpc32xx_sys_suspend_sz, GFP_KERNEL); + iram_swap_area = kmemdup((void *)TEMP_IRAM_AREA, + lpc32xx_sys_suspend_sz, GFP_KERNEL); if (!iram_swap_area) { printk(KERN_ERR "PM Suspend: cannot allocate memory to save portion " @@ -95,10 +96,6 @@ static int lpc32xx_pm_enter(suspend_state_t state) return -ENOMEM; } - /* Backup a small area of IRAM used for the suspend code */ - memcpy(iram_swap_area, (void *) TEMP_IRAM_AREA, - lpc32xx_sys_suspend_sz); - /* * Copy code to suspend system into IRAM. The suspend code * needs to run from IRAM as DRAM may no longer be available