From patchwork Thu Apr 18 10:11:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16202 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0BE6A23974 for ; Thu, 18 Apr 2013 10:13:36 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id p7sf3673977qcq.10 for ; Thu, 18 Apr 2013 03:12:59 -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=54F2pr19DtJ8Z8PdK3+b5WbxRBh8MwCvJJXw0oCr8Ys=; b=fCw8cl1DEEJrJlvXvhrJPmAcrpPp3xTGU7HqxX0juL+RrvO72+G1w8uJn0GLJLj0a/ OygBwtsGyPG+YO4BqO5UwDrn60OrRTuJUXqvhamkcwgGni2z4Xa+zjL2jYkLtj+Pgrls SSvxldO+vfyOq13L3NP+yG3cRCOC8zeucDIWIZWNR53rLEHoqZ99tg/2Wx+X7KR+RjJu mD61QPj+7hJcfS37K8GDVsK9ZeOQn173KtPBKaHrBe2+3ESDQC2oJLi1wC/V6cHgU5I1 2b+HdXphNyUbwDPOeY18zFLiJQBYm0LUQMEGWp2xEIMwp7cwBwpNzunxkppq4ahG9lKm gdjg== X-Received: by 10.236.91.109 with SMTP id g73mr5117814yhf.23.1366279979061; Thu, 18 Apr 2013 03:12:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.36.69 with SMTP id o5ls1231106qej.55.gmail; Thu, 18 Apr 2013 03:12:58 -0700 (PDT) X-Received: by 10.58.1.197 with SMTP id 5mr7626718veo.4.1366279978903; Thu, 18 Apr 2013 03:12:58 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id sx2si6228255vdc.97.2013.04.18.03.12.58 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 03:12:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 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.170; Received: by mail-vc0-f170.google.com with SMTP id lf10so2283681vcb.15 for ; Thu, 18 Apr 2013 03:12:58 -0700 (PDT) X-Received: by 10.220.175.3 with SMTP id v3mr7635647vcz.8.1366279978797; Thu, 18 Apr 2013 03:12:58 -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 nf2csp115744veb; Thu, 18 Apr 2013 03:12:58 -0700 (PDT) X-Received: by 10.194.95.198 with SMTP id dm6mr17488659wjb.6.1366279977645; Thu, 18 Apr 2013 03:12:57 -0700 (PDT) Received: from mail-we0-x235.google.com (mail-we0-x235.google.com [2a00:1450:400c:c03::235]) by mx.google.com with ESMTPS id le5si3424025wjb.219.2013.04.18.03.12.57 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 03:12:57 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::235 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c03::235; Received: by mail-we0-f181.google.com with SMTP id r6so2072431wey.26 for ; Thu, 18 Apr 2013 03:12:57 -0700 (PDT) X-Received: by 10.194.104.168 with SMTP id gf8mr17373285wjb.58.1366279977252; Thu, 18 Apr 2013 03:12:57 -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 ESMTPS id t7sm30483773wij.2.2013.04.18.03.12.55 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 03:12:56 -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, Lee Jones , Vinod Koul , Dan Williams , Per Forlin , Rabin Vincent Subject: [PATCH 14/32] dmaengine: ste_dma40: Remove 'always true' checking Date: Thu, 18 Apr 2013 11:11:56 +0100 Message-Id: <1366279934-30761-15-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1366279934-30761-1-git-send-email-lee.jones@linaro.org> References: <1366279934-30761-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQk8KtjUieya4U2HtUq9iG2sjsDvTvLBVPVhcbgsDgUzsJHu8YtM7Wc5pMnIAam8qYrZhoET X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.170 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: , Before allocating memory for logical channels, the current driver checks to see if there are any. Well as the dma40_memcpy_channels[] array is always populated, the check is always true. Best to remove the check. Cc: Vinod Koul Cc: Dan Williams Cc: Per Forlin Cc: Rabin Vincent Signed-off-by: Lee Jones --- drivers/dma/ste_dma40.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index a39ef74..ec0d6ab 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -3273,17 +3273,11 @@ static struct d40_base * __init d40_hw_detect_init(struct platform_device *pdev) if (!base->lookup_phy_chans) goto failure; - if (num_log_chans + ARRAY_SIZE(dma40_memcpy_channels)) { - /* - * The max number of logical channels are event lines for all - * src devices and dst devices - */ - base->lookup_log_chans = kzalloc(num_log_chans * - sizeof(struct d40_chan *), - GFP_KERNEL); - if (!base->lookup_log_chans) - goto failure; - } + base->lookup_log_chans = kzalloc(num_log_chans * + sizeof(struct d40_chan *), + GFP_KERNEL); + if (!base->lookup_log_chans) + goto failure; base->reg_val_backup_chan = kmalloc(base->num_phy_chans * sizeof(d40_backup_regs_chan),