From patchwork Thu Apr 18 10:11:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16197 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DCFF123974 for ; Thu, 18 Apr 2013 10:13:25 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id w16sf4367395vbb.10 for ; Thu, 18 Apr 2013 03:12:48 -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=Q0XVxnC1xtKjDHCwck+cN0FNt7vsYtTtyWG+slD8Mas=; b=id8/my9WDE/RNQr0aECI9rVsAsKtX5b1M7FrN4Og9d88clvB6+/Meyn+waQa874BZO u+ZCa1tVBLx7BMEQ7ka1lAke7klUjpj2SaeKJw23UNnWsvJ15xqD9txj51FzmSxbxH+x 5ZO1Asi1DwVuUWFx8JxAd8ikFCoOU0LIpxDDONofspQI62MGAF3i/cOIzv2mqX9tPNhw LA4uLRjgzk730PbU2g+XV2dS9lcaD6uWIZ3SCNwmpR9bDVczVN6/n/dTzmTbtngJr6mn BihAIXxl6bFc5QkiJDg4arcDugfvRB0gSn9bQDLFFysc3woo1QbUcX36CY1g/KAYU7aK y8Qw== X-Received: by 10.224.217.195 with SMTP id hn3mr7563817qab.5.1366279968887; Thu, 18 Apr 2013 03:12:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.27.10 with SMTP id p10ls1453271qeg.60.gmail; Thu, 18 Apr 2013 03:12:48 -0700 (PDT) X-Received: by 10.52.33.236 with SMTP id u12mr6428316vdi.101.1366279968765; Thu, 18 Apr 2013 03:12:48 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id da5si6213450vdc.141.2013.04.18.03.12.48 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 03:12:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 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.180; Received: by mail-vc0-f180.google.com with SMTP id m16so2285324vca.11 for ; Thu, 18 Apr 2013 03:12:48 -0700 (PDT) X-Received: by 10.52.71.4 with SMTP id q4mr6519530vdu.8.1366279968656; Thu, 18 Apr 2013 03:12:48 -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 nf2csp115734veb; Thu, 18 Apr 2013 03:12:48 -0700 (PDT) X-Received: by 10.181.11.196 with SMTP id ek4mr16947049wid.30.1366279967717; Thu, 18 Apr 2013 03:12:47 -0700 (PDT) Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [2a00:1450:400c:c05::235]) by mx.google.com with ESMTPS id r10si7191593wia.107.2013.04.18.03.12.47 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 03:12:47 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::235 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::235; Received: by mail-wi0-f181.google.com with SMTP id c10so1586063wiw.14 for ; Thu, 18 Apr 2013 03:12:47 -0700 (PDT) X-Received: by 10.180.91.131 with SMTP id ce3mr17001001wib.5.1366279967073; Thu, 18 Apr 2013 03:12:47 -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.44 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 03:12:45 -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 08/32] dmaengine: ste_dma40: Optimise local MAX() macro Date: Thu, 18 Apr 2013 11:11:50 +0100 Message-Id: <1366279934-30761-9-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: ALoCoQnuWX4G2LVuAUbpMnDKsp+/zp8i+Lv0YEscK1tiiEVvEUG1Ad4v1r2LTbIF7u72O81LLe+l X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.180 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: , The current implementation of the DMA40's local MAX() macro evaluates its arguments more times than is necessary. This patch strips it optimises it to only evaluate what's appropriate. Cc: Vinod Koul Cc: Dan Williams Cc: Per Forlin Cc: Rabin Vincent Reported-by: Harvey Harrison Signed-off-by: Lee Jones --- drivers/dma/ste_dma40.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index b21a8a3..7b451b2 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -53,7 +53,7 @@ #define D40_ALLOC_PHY BIT(30) #define D40_ALLOC_LOG_FREE BIT(0) -#define MAX(a, b) (((a) < (b)) ? (b) : (a)) +#define MAX(a, b) ((a > b) ? a : b) #define D40_IS_SRC(dir) ((dir == STEDMA40_PERIPH_TO_MEM) ? true : false) #define D40_IS_DST(dir) (((dir == STEDMA40_MEM_TO_PERIPH) || \