From patchwork Wed May 9 13:55:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10389607 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 3FC5160153 for ; Wed, 9 May 2018 13:55:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FAF228FAA for ; Wed, 9 May 2018 13:55:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2444728FBE; Wed, 9 May 2018 13:55:48 +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 EC84B28FAA for ; Wed, 9 May 2018 13:55:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934946AbeEINzn (ORCPT ); Wed, 9 May 2018 09:55:43 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:58836 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934693AbeEINzj (ORCPT ); Wed, 9 May 2018 09:55:39 -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=KFRvFbPmH9UpPp+MJrOTb8DoE wD9FPyugxqda01NHoH3z318QhwDN6oDbRM0pZNSv/qMtXHAW/s7dyVtx1mKXikoozExOPgJLswf1K UtaXND4vSGzoJx5UfqkMh8QhBmhJttlONacgn8UtBOv5Pk08zgNbZLoUFJplek1d2FRCUm08eZRfs qZq84tm1jXdee6Hk5+pam+nI6QQITAD2n55ENTIx2Ho7iFwyhHbFZ6ytQk40Wr/fb1018gn4WJjpK /SRrCFBwO2I3xN38qCgvf2TrowDPrv2L+K46fBgFTum63ub0OXWNmXSV0FyU7t7nXXbeL7TTs5P+6 2KXGQg6SQ==; Received: from 213-225-15-246.nat.highway.a1.net ([213.225.15.246] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGPZC-0001pB-QR for linux-mmc@vger.kernel.org; Wed, 09 May 2018 13:55:39 +0000 From: Christoph Hellwig To: linux-mmc@vger.kernel.org Subject: [PATCH 1/7] mmc: android-goldfish: use sg_copy_{from,to}_buffer Date: Wed, 9 May 2018 15:55:19 +0200 Message-Id: <20180509135525.19885-2-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509135525.19885-1-hch@lst.de> References: <20180509135525.19885-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); } }