Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753786Ab3DPFh4 (ORCPT ); Tue, 16 Apr 2013 01:37:56 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:57346 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751002Ab3DPFhz (ORCPT ); Tue, 16 Apr 2013 01:37:55 -0400 X-AuditID: cbfee690-b7f656d0000007e3-f8-516ce3b1173d Date: Tue, 16 Apr 2013 05:37:53 +0000 (GMT) From: EUNBONG SONG Subject: [PATCH] swiotlb: Replace dma_length to sg_dma_len() macro To: konrad.wilk@oracle.com Cc: "linux-kernel@vger.kernel.org" Reply-to: eunb.song@samsung.com MIME-version: 1.0 X-MTR: 20130416052655212@eunb.song Msgkey: 20130416052655212@eunb.song X-EPLocale: ko_KR.euc-kr X-Priority: 3 X-EPWebmail-Msg-Type: personal X-EPWebmail-Reply-Demand: 0 X-EPApproval-Locale: X-EPHeader: ML X-EPTrCode: X-EPTrName: X-MLAttribute: X-RootMTR: 20130416052655212@eunb.song X-ParentMTR: X-ArchiveUser: X-CPGSPASS: N Content-type: text/plain; charset=euc-kr MIME-version: 1.0 Message-id: <25826040.283591366090672676.JavaMail.weblogic@epml15> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplleLIzCtJLcpLzFFi42I5/e+Zju7GxzmBBq3LxCwu75rD5sDo8XmT XABjFJdNSmpOZllqkb5dAlfGr1WTmAueCFQ0H/jD3MC4QqCLkZNDSEBFouX/d8YuRg4OCQET ibcXJEDCEgJiEhfurWfrYuQCKlnGKPHv5zImiISJxOevr1ghEvMZJa6sPAqWYBFQlbj54gQL iM0moC3x9ssDVhBbWMBZ4sejO8wgC0QE5CWO7QJbwCzgKPHoMkgY5AZ5icmnL7OD2LwCghIn Zz5hgdilJHGoaSETRFxZ4s6faVBxCYlZ0y+wQti8EjPan0LF5SSmfV3DDGFLS5yftYER5pnF 3x9Dxfkljt3ewQTxL6/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ZkNQsYWVYxiqYWJBcUJ6VXmOgVJ+YWl+al6yXn525iBCeoZ0t2MDZcsD7E KMDBqMTDGyCfEyjEmlhWXJl7iFGCg1lJhFd9OVCINyWxsiq1KD++qDQntfgQYzIw/iYyS4km 5wOTZ15JvKGxgbGhoaW5gamhkQVpwkrivM9arQOFBNITS1KzU1MLUotgtjBxcEo1MN6QucJw vCOE8f2qC6kbu99ZnRM6I1XS53oy5WuJKuvNUymh3zRO734nOHm39Dp9z3DR64cOJ0rkbpwR k7oq1f2b+T4Z5ToN82d+91Z++jv5u6LiBG5TllShXw9vfpHw/zhdsejwltTe/J2KDXsE10qK Woa8mrDuMo8Dp/nc7kybBDNV/aVBH5RYijMSDbWYi4oTASfbwiKUAwAA DLP-Filter: Pass X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id r3G5c4RK000658 Content-Length: 1674 Lines: 52 This patch replace dma_length in "lib/swiotlb.c" to sg_dma_len() macro, because the build error can occur if CONFIG_NEED_SG_DMA_LENGTH is not set, and CONFIG_SWIOTLB is set. I confirmed compile only. Singed-off-by: EunBong Song --- lib/swiotlb.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/swiotlb.c b/lib/swiotlb.c index bfe02b8..7b16f4a 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c @@ -859,13 +859,13 @@ swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, swiotlb_full(hwdev, sg->length, dir, 0); swiotlb_unmap_sg_attrs(hwdev, sgl, i, dir, attrs); - sgl[0].dma_length = 0; + sg_dma_len(sgl) = 0; return 0; } sg->dma_address = phys_to_dma(hwdev, map); } else sg->dma_address = dev_addr; - sg->dma_length = sg->length; + sg_dma_len(sg) = sg->length; } return nelems; } @@ -893,7 +893,7 @@ swiotlb_unmap_sg_attrs(struct device *hwdev, struct scatterlist *sgl, BUG_ON(dir == DMA_NONE); for_each_sg(sgl, sg, nelems, i) - unmap_single(hwdev, sg->dma_address, sg->dma_length, dir); + unmap_single(hwdev, sg->dma_address, sg_dma_len(sg), dir); } EXPORT_SYMBOL(swiotlb_unmap_sg_attrs); @@ -923,7 +923,7 @@ swiotlb_sync_sg(struct device *hwdev, struct scatterlist *sgl, for_each_sg(sgl, sg, nelems, i) swiotlb_sync_single(hwdev, sg->dma_address, - sg->dma_length, dir, target); + sg_dma_len(sg), dir, target); } void -- 1.7.0.4 ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?