Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3696629imu; Mon, 28 Jan 2019 09:12:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN4XBRQRkE5sgbUop+L1A4ZPBSt/WCeKaR6NWddt9VxQhadHrrK2/0iHQA4gn9nOrTxtCPMw X-Received: by 2002:a63:6cc:: with SMTP id 195mr20622853pgg.401.1548695554972; Mon, 28 Jan 2019 09:12:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548695554; cv=none; d=google.com; s=arc-20160816; b=gcqki+L2wMfDaNFuzxfp91IlQHwVdW6Dm41HvBxbhKqVeoLoEy/nN5DSXM6oF0q9yJ atOgy7sM+tjpnzRbuQiNd5PshvQPyq0qJqGSckXsPKefnpmV1iOA+UuQ5ot186qN8gIM OU4gsNBemIPuXAanrusaroi5z9lphOx44hbLW6yZd5Cmsja6Ff9GtncmQ0oZ6HYW+fj4 ZefXLgpL0MW3FkeJGzJViaxy+li+Y7KZXjUbq3+L1QwvdjXQ/ZX6c8hFaNRT4SoMGaY9 znIUrGtFZzCdqZIe8uAXKScMHDe3Z3CKpQuX9UuVtziAXqzj+YOKApvQ9jyUehqhSa31 G7WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jiwr5FGC8CsAtWQtVCiXG76Ub8YzcTNOMaCVeKk+7W4=; b=IhO7XSt5CKeSARDuLnDr7xFRoqz4CcYi91AmgrGSMLXz8jGbaMVkMO36I0/AVSZZjY l4uJR9Q5ZYkyOuDWXIIgL3xcnBVAtB1hnDaE/STr1m5diq0EkkvNOVbeu7CyCK4z8HNH VwyBEqizPCtxPJY0Bb/TLbHXGsYuuQ4pMKBK65MvH9E3LKgIBgK9+XCNVJq8ZAAJgKVb LmgVAS23myt80DqM2LO7PkOGHWKCzvIU7MI+vdK6JcptY01+Qfg3JXhENmi92XNCq0ew wAAe9FSEQsiJ3Yi8Jzpbtq35yDo6IZD8TsAQat5YA1kWUrbVXFysukKeXRvEpQHa9jKT +4sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M7mLkBVC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 203si9951194pgb.440.2019.01.28.09.12.19; Mon, 28 Jan 2019 09:12:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M7mLkBVC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732730AbfA1QKK (ORCPT + 99 others); Mon, 28 Jan 2019 11:10:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:35638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731846AbfA1QKH (ORCPT ); Mon, 28 Jan 2019 11:10:07 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 984B22173C; Mon, 28 Jan 2019 16:10:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691807; bh=U0yYD2++o2KSoLg1EAb0XjmFBMknCsYSZ/X114Occ6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M7mLkBVC9Ve9xoyywUzGp7rDo3YtwWOVRWmy1iyR1CUzUy2L3yy85iLnbYZFlJtCD MxBOkoMH+aTw1D7mQ8CvTQUIjmg1PblBuicshd13L1xrxnPQqj2pXl79tOn7OGMUu7 w02Pz0zh9jFixLRlrWHAetZHnWEv2IlltPUAXI/U= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Chancellor , Herbert Xu , Sasha Levin , linux-crypto@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 223/258] crypto: ux500 - Use proper enum in cryp_set_dma_transfer Date: Mon, 28 Jan 2019 10:58:49 -0500 Message-Id: <20190128155924.51521-223-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit 9d880c5945c748d8edcac30965f3349a602158c4 ] Clang warns when one enumerated type is implicitly converted to another: drivers/crypto/ux500/cryp/cryp_core.c:559:5: warning: implicit conversion from enumeration type 'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion] direction, DMA_CTRL_ACK); ^~~~~~~~~ drivers/crypto/ux500/cryp/cryp_core.c:583:5: warning: implicit conversion from enumeration type 'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion] direction, ^~~~~~~~~ 2 warnings generated. dmaengine_prep_slave_sg expects an enum from dma_transfer_direction. Because we know the value of the dma_data_direction enum from the switch statement, we can just use the proper value from dma_transfer_direction so there is no more conversion. DMA_TO_DEVICE = DMA_MEM_TO_DEV = 1 DMA_FROM_DEVICE = DMA_DEV_TO_MEM = 2 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/ux500/cryp/cryp_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c index d2663a4e1f5e..a92a66b1ff46 100644 --- a/drivers/crypto/ux500/cryp/cryp_core.c +++ b/drivers/crypto/ux500/cryp/cryp_core.c @@ -556,7 +556,7 @@ static int cryp_set_dma_transfer(struct cryp_ctx *ctx, desc = dmaengine_prep_slave_sg(channel, ctx->device->dma.sg_src, ctx->device->dma.sg_src_len, - direction, DMA_CTRL_ACK); + DMA_MEM_TO_DEV, DMA_CTRL_ACK); break; case DMA_FROM_DEVICE: @@ -580,7 +580,7 @@ static int cryp_set_dma_transfer(struct cryp_ctx *ctx, desc = dmaengine_prep_slave_sg(channel, ctx->device->dma.sg_dst, ctx->device->dma.sg_dst_len, - direction, + DMA_DEV_TO_MEM, DMA_CTRL_ACK | DMA_PREP_INTERRUPT); -- 2.19.1