From patchwork Mon Sep 28 20:20:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 7279871 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2011ABEEA4 for ; Mon, 28 Sep 2015 20:24:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A7F120711 for ; Mon, 28 Sep 2015 20:24:02 +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 2D6B420573 for ; Mon, 28 Sep 2015 20:24:01 +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 1ZgewC-0003pm-MG; Mon, 28 Sep 2015 20:22:16 +0000 Received: from mga11.intel.com ([192.55.52.93]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZgevV-0003h3-CI for linux-arm-kernel@lists.infradead.org; Mon, 28 Sep 2015 20:21:34 +0000 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 28 Sep 2015 13:21:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,604,1437462000"; d="scan'208";a="570036632" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by FMSMGA003.fm.intel.com with ESMTP; 28 Sep 2015 13:21:07 -0700 Received: from nauris.fi.intel.com (nauris.localdomain [192.168.240.2]) by paasikivi.fi.intel.com (Postfix) with ESMTP id 36DD420460; Mon, 28 Sep 2015 23:21:06 +0300 (EEST) Received: by nauris.fi.intel.com (Postfix, from userid 1000) id 15DE8201F0; Mon, 28 Sep 2015 23:20:55 +0300 (EEST) From: Sakari Ailus To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/1] arm: mm: Fix comments in sg_sync functions Date: Mon, 28 Sep 2015 23:20:55 +0300 Message-Id: <1443471655-28302-1-git-send-email-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.1.0.231.g7484e3b X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150928_132133_436831_CBD36F71 X-CRM114-Status: GOOD ( 10.62 ) X-Spam-Score: -6.9 (------) 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: bhelgaas@google.com, djkurtz@chromium.org 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 comment on the usage of arm_dma_sync_sg_for_cpu(), arm_dma_sync_sg_for_device(), arm_iommu_sync_sg_for_cpu() and arm_iommu_sync_sg_for_device() functions wrongly noted that the "nelems" parameter is the number of sglist entries returned by dma_map_sg(), while this must be the number of entiries passed to dma_map_sg() instead. Suggested-by: Daniel Kurtz Signed-off-by: Sakari Ailus Reviewed-by: Robin Murphy --- Hi folks, This related patch was applied to Jonathan Corbet's tree: The comments were indeed wrong. This may have contributed to a related videobuf2 bug: arch/arm/mm/dma-mapping.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index e626043..1c0154a 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -958,7 +958,7 @@ void arm_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, * arm_dma_sync_sg_for_cpu * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices * @sg: list of buffers - * @nents: number of buffers to map (returned from dma_map_sg) + * @nents: number of buffers to sync (same as was passed to dma_map_sg) * @dir: DMA transfer direction (same as was passed to dma_map_sg) */ void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, @@ -977,7 +977,7 @@ void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, * arm_dma_sync_sg_for_device * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices * @sg: list of buffers - * @nents: number of buffers to map (returned from dma_map_sg) + * @nents: number of buffers to sync (same as was passed to dma_map_sg) * @dir: DMA transfer direction (same as was passed to dma_map_sg) */ void arm_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, @@ -1672,7 +1672,7 @@ void arm_iommu_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, * arm_iommu_sync_sg_for_cpu * @dev: valid struct device pointer * @sg: list of buffers - * @nents: number of buffers to map (returned from dma_map_sg) + * @nents: number of buffers to sync (same as was passed to dma_map_sg) * @dir: DMA transfer direction (same as was passed to dma_map_sg) */ void arm_iommu_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, @@ -1690,7 +1690,7 @@ void arm_iommu_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, * arm_iommu_sync_sg_for_device * @dev: valid struct device pointer * @sg: list of buffers - * @nents: number of buffers to map (returned from dma_map_sg) + * @nents: number of buffers to sync (same as was passed to dma_map_sg) * @dir: DMA transfer direction (same as was passed to dma_map_sg) */ void arm_iommu_sync_sg_for_device(struct device *dev, struct scatterlist *sg,