From patchwork Sat Mar 21 23:51:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 6065791 Return-Path: X-Original-To: patchwork-dmaengine@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 439A2BF90F for ; Sat, 21 Mar 2015 23:51:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43C86202E6 for ; Sat, 21 Mar 2015 23:51:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B6DB20270 for ; Sat, 21 Mar 2015 23:51:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751314AbbCUXvO (ORCPT ); Sat, 21 Mar 2015 19:51:14 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:44021 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751159AbbCUXvN (ORCPT ); Sat, 21 Mar 2015 19:51:13 -0400 Received: from trochilidae.agner.local (195-226-23-137.pool.cyberlink.ch [195.226.23.137]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 325E85C000F; Sun, 22 Mar 2015 00:50:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=agner.ch; s=dkim; t=1426981843; bh=Sq4SsqqKihOUHx/0TNScEOMBW3VFOaR3DrCjgPFLjUE=; h=From:To:Cc:Subject:Date:From; b=eyQ3zWWA6pRevMfCRdLjVYUFaPfdIo5a0P2PmzRfPY3AfJlHEesB9UaCpxJoyeOPi li/MKjkGdixC/oTgsk5To7ArvAeObzN6z97CcTbHUMC90e012zu3U2Xe1j3tGH9/OI P2hnTzITd0xNEG/CSO2VQFnqtFw8JtHUl5/z23LA= From: Stefan Agner To: linus.walleij@linaro.org, vinod.koul@intel.com Cc: dan.j.williams@intel.com, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvmlinux@lists.linuxfoundation.org, Stefan Agner Subject: [PATCH] dmaengine: ste_dma40: fix implicit conversion Date: Sun, 22 Mar 2015 00:51:08 +0100 Message-Id: <1426981868-1988-1-git-send-email-stefan@agner.ch> X-Mailer: git-send-email 2.3.3 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham 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 function d40_prep_sg takes the type enum dma_transfer_direction as second last parameter. However, the memcpy calls pass DMA_NONE which is of type enum dma_data_direction. Fix this by passing the actual transfer direction DMA_MEM_TO_MEM. This does not change the actual code flow since only the transfer direction DMA_MEM_TO_DEV and DMA_DEV_TO_MEM are actually used in the function d40_prep_sg. Signed-off-by: Stefan Agner --- This was uncovered by a LLVM/clang warnings: drivers/dma/ste_dma40.c:2505:48: warning: implicit conversion from enumeration type 'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion] return d40_prep_sg(chan, &src_sg, &dst_sg, 1, DMA_NONE, dma_flags); ~~~~~~~~~~~ ^~~~~~~~ drivers/dma/ste_dma40.c:2517:54: warning: implicit conversion from enumeration type 'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion] return d40_prep_sg(chan, src_sg, dst_sg, src_nents, DMA_NONE, dma_flags); ~~~~~~~~~~~ ^~~~~~~~ drivers/dma/ste_dma40.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 15d4946..ace03dc 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -2502,7 +2502,8 @@ static struct dma_async_tx_descriptor *d40_prep_memcpy(struct dma_chan *chan, sg_dma_len(&dst_sg) = size; sg_dma_len(&src_sg) = size; - return d40_prep_sg(chan, &src_sg, &dst_sg, 1, DMA_NONE, dma_flags); + return d40_prep_sg(chan, &src_sg, &dst_sg, 1, + DMA_MEM_TO_MEM, dma_flags); } static struct dma_async_tx_descriptor * @@ -2514,7 +2515,8 @@ d40_prep_memcpy_sg(struct dma_chan *chan, if (dst_nents != src_nents) return NULL; - return d40_prep_sg(chan, src_sg, dst_sg, src_nents, DMA_NONE, dma_flags); + return d40_prep_sg(chan, src_sg, dst_sg, src_nents, + DMA_MEM_TO_MEM, dma_flags); } static struct dma_async_tx_descriptor *