From patchwork Fri May 3 14:31:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16640 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C09C523905 for ; Fri, 3 May 2013 14:33:49 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id gf12sf2896718vcb.0 for ; Fri, 03 May 2013 07:33:40 -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 :in-reply-to:references: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=LlsLwA46CA6Z2fCCRBFIVbqDzpIAPcH2/TY/Ju4T24gvHZtvvtjC09hb9r6iVvkoba tk+amHq2czXmdGhNpW+WFmthfXiXnUWp9phmBPV7ODoNFKaOUcvvQSKKSJceiN/A+uJe +zUvK2RfBNeSZIVRcB0DoQ4bMKWKEyGKESDlAKJDckZpf4v2jP503VQP6h+7jGe09B0l fVZcf61qzLERYVh18LpBS9UXabfhcV2O3bkOL0StEeUkhp1lBp9sXxojzradVweHi1ky Yiyo4xSLWLkD7jSi6OnlohMKsWlCBIbBymxHZqlkduQBNLcoPZy57WrFsQmuUUch67/j TIrw== X-Received: by 10.236.189.241 with SMTP id c77mr8668753yhn.17.1367591619964; Fri, 03 May 2013 07:33:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.41 with SMTP id 9ls1838188qez.41.gmail; Fri, 03 May 2013 07:33:39 -0700 (PDT) X-Received: by 10.52.22.164 with SMTP id e4mr3156959vdf.56.1367591619681; Fri, 03 May 2013 07:33:39 -0700 (PDT) Received: from mail-ve0-x22e.google.com (mail-ve0-x22e.google.com [2607:f8b0:400c:c01::22e]) by mx.google.com with ESMTPS id b7si5151980vco.76.2013.05.03.07.33.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 May 2013 07:33:39 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22e is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22e; Received: by mail-ve0-f174.google.com with SMTP id pb11so1557758veb.33 for ; Fri, 03 May 2013 07:33:39 -0700 (PDT) X-Received: by 10.221.0.199 with SMTP id nn7mr3768900vcb.14.1367591619599; Fri, 03 May 2013 07:33:39 -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 nf2csp25160veb; Fri, 3 May 2013 07:33:39 -0700 (PDT) X-Received: by 10.180.82.74 with SMTP id g10mr27318111wiy.10.1367591618432; Fri, 03 May 2013 07:33:38 -0700 (PDT) Received: from mail-we0-x236.google.com (mail-we0-x236.google.com [2a00:1450:400c:c03::236]) by mx.google.com with ESMTPS id fw17si9806017wic.113.2013.05.03.07.33.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 May 2013 07:33:38 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::236 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c03::236; Received: by mail-we0-f182.google.com with SMTP id r46so1394769wey.13 for ; Fri, 03 May 2013 07:33:38 -0700 (PDT) X-Received: by 10.194.109.136 with SMTP id hs8mr14354963wjb.8.1367591618033; Fri, 03 May 2013 07:33:38 -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 o3sm17516019wia.2.2013.05.03.07.33.36 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 May 2013 07:33:37 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, srinidhi.kasagar@stericsson.com, Lee Jones Subject: [PATCH 09/63] dmaengine: ste_dma40: Rectify incorrect configuration validation checking Date: Fri, 3 May 2013 15:31:55 +0100 Message-Id: <1367591569-32197-10-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1367591569-32197-1-git-send-email-lee.jones@linaro.org> References: <1367591569-32197-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkLwIGbyKDEcO0iE+YcxpLLQJAqgeruOX/Tg0MGGyR4EuWlBhMdxvv9DfMiuAqjUh1Nz5ut X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22e 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; }