From patchwork Wed May 1 14:26:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16556 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 479FD23942 for ; Wed, 1 May 2013 14:26:59 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id j8sf2644999qah.8 for ; Wed, 01 May 2013 07:26:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=6njS/0WUKbglggZtnF2OzQ+TcjF1wAMV18pqnUaC7oo=; b=ZlhFIEVPESzV5GMYO3/WraNExWEAfgPJII8OpUZYxoIe78IcbxOD3WgASMumWuEw9I UlT6nP5y5HB/lXoHLtTw5bWOL7J4BYpBwX6VWDD95r4Ct2M4LzaTmWL9J8LmYnfE3ZvB 6usy09ONqUFukA7c4p5jh/z7NY99GbJBH9xAq0R+Vw9u0AI9FISu2Xmg2hzY3HBakRZx 5BWhIGMZYy/lzER2lPE/A15xG6USEvwyTp7Rw6KCSFXhMUCkDVSUPpQ+uJaq43tvEDuC 2QLrazpzXFj2s2/CuT9R00QN5bmQKKFq853dghENRzrweytTSKM8p+PGnJKm+g5ikwVQ Wjog== X-Received: by 10.236.61.42 with SMTP id v30mr2176582yhc.15.1367418413734; Wed, 01 May 2013 07:26:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.98.35 with SMTP id ef3ls720444qeb.95.gmail; Wed, 01 May 2013 07:26:53 -0700 (PDT) X-Received: by 10.220.67.67 with SMTP id q3mr901269vci.38.1367418413470; Wed, 01 May 2013 07:26:53 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id x12si1289674vcv.72.2013.05.01.07.26.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 07:26:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf10so1287779vcb.20 for ; Wed, 01 May 2013 07:26:53 -0700 (PDT) X-Received: by 10.52.166.103 with SMTP id zf7mr763145vdb.94.1367418413370; Wed, 01 May 2013 07:26:53 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp157308veb; Wed, 1 May 2013 07:26:52 -0700 (PDT) X-Received: by 10.194.178.162 with SMTP id cz2mr3146213wjc.27.1367418411965; Wed, 01 May 2013 07:26:51 -0700 (PDT) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [2a00:1450:400c:c05::22e]) by mx.google.com with ESMTPS id x6si869695wiv.71.2013.05.01.07.26.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 07:26:51 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::22e is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::22e; Received: by mail-wi0-f174.google.com with SMTP id m6so4958571wiv.13 for ; Wed, 01 May 2013 07:26:51 -0700 (PDT) X-Received: by 10.180.184.11 with SMTP id eq11mr3030560wic.30.1367418411456; Wed, 01 May 2013 07:26:51 -0700 (PDT) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPSA id q20sm4244832wiv.7.2013.05.01.07.26.49 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 07:26:50 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, vinod.koul@intel.com, per.forlin@stericsson.com, rabin@rab.in Cc: arnd@arndb.de, linus.walleij@stericsson.com, srinidhi.kasagar@stericsson.com, Lee Jones Subject: [PATCH] dmaengine: ste_dma40: Rectify incorrect configuration validation checking Date: Wed, 1 May 2013 15:26:38 +0100 Message-Id: <1367418399-30591-1-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQkw+lVfaU1RHbu+4NOL8vn5AiumuFts/kjnx6UZAvMY7YT63K8S67ISwXMDPUOnRo+0gHvW X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , If we compare an event's group (dev_type / 16) with STEDMA40_DEV_DST_MEMORY (-1), the only way we'd obtain a positive result is if we passed -16 as a device type, which is unfeasible. Instead, it would be much more sane to compare STEDMA40_DEV_DST_MEMORY against the raw dev_type in order to expect the expected result. Signed-off-by: Lee Jones --- drivers/dma/ste_dma40.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 3b83dee..c79853f 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -1771,19 +1771,19 @@ static int d40_validate_conf(struct d40_chan *d40c, } if (conf->dir == STEDMA40_MEM_TO_PERIPH && - dst_event_group == STEDMA40_DEV_DST_MEMORY) { + conf->dst_dev_type == STEDMA40_DEV_DST_MEMORY) { chan_err(d40c, "Invalid dst\n"); res = -EINVAL; } if (conf->dir == STEDMA40_PERIPH_TO_MEM && - src_event_group == STEDMA40_DEV_SRC_MEMORY) { + conf->src_dev_type == STEDMA40_DEV_SRC_MEMORY) { chan_err(d40c, "Invalid src\n"); res = -EINVAL; } - if (src_event_group == STEDMA40_DEV_SRC_MEMORY && - dst_event_group == STEDMA40_DEV_DST_MEMORY && is_log) { + if (conf->src_dev_type == STEDMA40_DEV_SRC_MEMORY && + conf->dst_dev_type == STEDMA40_DEV_DST_MEMORY && is_log) { chan_err(d40c, "No event line\n"); res = -EINVAL; }