From patchwork Fri May 18 17:18:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10411665 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A704C6031B for ; Fri, 18 May 2018 17:18:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9773328932 for ; Fri, 18 May 2018 17:18:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BEA428963; Fri, 18 May 2018 17:18:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 063EA28932 for ; Fri, 18 May 2018 17:18:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751744AbeERRSy (ORCPT ); Fri, 18 May 2018 13:18:54 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:45454 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751693AbeERRSx (ORCPT ); Fri, 18 May 2018 13:18:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OXXjKFBgGy6X42zGYCw18oS4inIWWpiRmOdJOi+sksU=; b=dIi9+2q6MyXvQUqPIpAbRHqtA CMRJP5U8kbgiE01Q+B7dHQPHKvFbg/BjwNMqfdik5EpN20dTg6y4q/L+/nmje9OVbZfBozi+KgV9X 07nIQBI30OeUJM1T/HASFQQ06l8+G54E+RvplLsTGt4GUwVX6u26X8en4ltjdpldYEFO4JlGMVRPt oM8kA5I/j088eEhb4bvngXXkNvU5b3jurj3ABd//l9uXJya1izYLuNwJmwAkhXLggA47kS7VNkOrP X0rbPSIyn8aLxzzvcO1/ENxVg6ZD0tOLoyD8HZWJhDKrX42CU4yZwAnHexxZIlHcMgOPuAbLJW9KN 0uwkQ9x+w==; Received: from 80-109-164-210.cable.dynamic.surfer.at ([80.109.164.210] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJj1o-0007AZ-Vf for linux-mmc@vger.kernel.org; Fri, 18 May 2018 17:18:53 +0000 From: Christoph Hellwig To: linux-mmc@vger.kernel.org Subject: [PATCH 1/7] mmc: android-goldfish: use sg_copy_{from,to}_buffer Date: Fri, 18 May 2018 19:18:41 +0200 Message-Id: <20180518171847.16419-2-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518171847.16419-1-hch@lst.de> References: <20180518171847.16419-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This handles highmem pages, and also cleans up the code. Signed-off-by: Christoph Hellwig --- drivers/mmc/host/android-goldfish.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/android-goldfish.c b/drivers/mmc/host/android-goldfish.c index 63d27589cd89..294de177632c 100644 --- a/drivers/mmc/host/android-goldfish.c +++ b/drivers/mmc/host/android-goldfish.c @@ -217,8 +217,8 @@ static void goldfish_mmc_xfer_done(struct goldfish_mmc_host *host, * We don't really have DMA, so we need * to copy from our platform driver buffer */ - uint8_t *dest = (uint8_t *)sg_virt(data->sg); - memcpy(dest, host->virt_base, data->sg->length); + sg_copy_to_buffer(data->sg, 1, host->virt_base, + data->sg->length); } host->data->bytes_xfered += data->sg->length; dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->sg_len, @@ -393,8 +393,8 @@ static void goldfish_mmc_prepare_data(struct goldfish_mmc_host *host, * We don't really have DMA, so we need to copy to our * platform driver buffer */ - const uint8_t *src = (uint8_t *)sg_virt(data->sg); - memcpy(host->virt_base, src, data->sg->length); + sg_copy_from_buffer(data->sg, 1, host->virt_base, + data->sg->length); } }