From patchwork Fri May 3 14:32:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16684 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D38FA25DFE for ; Fri, 3 May 2013 14:35:30 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id i13sf1236634qae.3 for ; Fri, 03 May 2013 07:35:21 -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=FZ0W+1sSSgZLw6VWCasw1tDBn+4Jly5OoGW53VDSuVI=; b=bAu3XvT2bkoHkV4qJ1tF+sntUDarTOI0IdDxd8emYFVnXqBa/IOwbZ3eINx24I1WbC T9lhqiTbKQ7CSQ5/BYnOenfJB9msoJJWjv1IJyofoFfVonqDEHx1OGzIlraHRpF6vqK4 eWHCRQRg8RpFgrpwqHmz0jUB01P6aZhjJpBKBuy5SzNRZ+mu4OF0Z4cw7+HHvFyrwdfb OGdqwFNb13Eb1knFYpD1aObE3EegGrFqyrrFuYB0YN+VaE3lSCPeKjHq83IqNWlhihsU gD98A9oNFqZQ7egR2wQf+GULnS9bHhFyM0pDVXjgiu4ArKuoXl1ZVCowHW7e0gjbW/FZ 8+wg== X-Received: by 10.236.84.177 with SMTP id s37mr8038490yhe.37.1367591720795; Fri, 03 May 2013 07:35:20 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.88.6 with SMTP id bc6ls1919356qeb.85.gmail; Fri, 03 May 2013 07:35:20 -0700 (PDT) X-Received: by 10.52.33.236 with SMTP id u12mr3076296vdi.101.1367591720600; Fri, 03 May 2013 07:35:20 -0700 (PDT) Received: from mail-ve0-x22f.google.com (mail-ve0-x22f.google.com [2607:f8b0:400c:c01::22f]) by mx.google.com with ESMTPS id ow6si5179720vcb.17.2013.05.03.07.35.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 May 2013 07:35:20 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22f 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::22f; Received: by mail-ve0-f175.google.com with SMTP id m1so1561741ves.34 for ; Fri, 03 May 2013 07:35:20 -0700 (PDT) X-Received: by 10.58.144.231 with SMTP id sp7mr3745739veb.34.1367591720521; Fri, 03 May 2013 07:35:20 -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 nf2csp25278veb; Fri, 3 May 2013 07:35:20 -0700 (PDT) X-Received: by 10.194.235.169 with SMTP id un9mr14350558wjc.1.1367591719606; Fri, 03 May 2013 07:35:19 -0700 (PDT) Received: from mail-wg0-x230.google.com (mail-wg0-x230.google.com [2a00:1450:400c:c00::230]) by mx.google.com with ESMTPS id cs4si3607684wjb.127.2013.05.03.07.35.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 May 2013 07:35:19 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::230 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c00::230; Received: by mail-wg0-f48.google.com with SMTP id f11so1631893wgh.3 for ; Fri, 03 May 2013 07:35:19 -0700 (PDT) X-Received: by 10.180.183.210 with SMTP id eo18mr40909062wic.17.1367591719024; Fri, 03 May 2013 07:35:19 -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.35.17 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 May 2013 07:35:18 -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 53/63] dmaengine: ste_dma40: Use the BIT macro to replace ugly '(1 << x)'s Date: Fri, 3 May 2013 15:32:39 +0100 Message-Id: <1367591569-32197-54-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: ALoCoQmvuwLNHVL3qH5CK9uDEVkz5VtmNZMENx1fhfs5vuqwFAbE94D9AZ7e5BCOtT3DHrhSuYYX X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22f 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 aim is to make the code that little more readable. Acked-by: Vinod Koul Acked-by: Arnd Bergmann Reviewed-by: Linus Walleij Signed-off-by: Lee Jones --- drivers/dma/ste_dma40.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 555d851..8e7fa9d 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -54,8 +54,8 @@ #define MAX_LCLA_ALLOC_ATTEMPTS 256 /* Bit markings for allocation map */ -#define D40_ALLOC_FREE (1 << 31) -#define D40_ALLOC_PHY (1 << 30) +#define D40_ALLOC_FREE BIT(31) +#define D40_ALLOC_PHY BIT(30) #define D40_ALLOC_LOG_FREE 0 /* Reserved event lines for memcpy only. */ @@ -1724,7 +1724,7 @@ static irqreturn_t d40_handle_interrupt(int irq, void *data) } /* ACK interrupt */ - writel(1 << idx, base->virtbase + il[row].clr); + writel(BIT(idx), base->virtbase + il[row].clr); spin_lock(&d40c->lock); @@ -1814,8 +1814,8 @@ static bool d40_alloc_mask_set(struct d40_phy_res *phy, if (phy->allocated_src == D40_ALLOC_FREE) phy->allocated_src = D40_ALLOC_LOG_FREE; - if (!(phy->allocated_src & (1 << log_event_line))) { - phy->allocated_src |= 1 << log_event_line; + if (!(phy->allocated_src & BIT(log_event_line))) { + phy->allocated_src |= BIT(log_event_line); goto found; } else goto not_found; @@ -1826,8 +1826,8 @@ static bool d40_alloc_mask_set(struct d40_phy_res *phy, if (phy->allocated_dst == D40_ALLOC_FREE) phy->allocated_dst = D40_ALLOC_LOG_FREE; - if (!(phy->allocated_dst & (1 << log_event_line))) { - phy->allocated_dst |= 1 << log_event_line; + if (!(phy->allocated_dst & BIT(log_event_line))) { + phy->allocated_dst |= BIT(log_event_line); goto found; } else goto not_found; @@ -1857,11 +1857,11 @@ static bool d40_alloc_mask_free(struct d40_phy_res *phy, bool is_src, /* Logical channel */ if (is_src) { - phy->allocated_src &= ~(1 << log_event_line); + phy->allocated_src &= ~BIT(log_event_line); if (phy->allocated_src == D40_ALLOC_LOG_FREE) phy->allocated_src = D40_ALLOC_FREE; } else { - phy->allocated_dst &= ~(1 << log_event_line); + phy->allocated_dst &= ~BIT(log_event_line); if (phy->allocated_dst == D40_ALLOC_LOG_FREE) phy->allocated_dst = D40_ALLOC_FREE; } @@ -2342,7 +2342,7 @@ static void __d40_set_prio_rt(struct d40_chan *d40c, int dev_type, bool src) u32 rtreg; u32 event = D40_TYPE_TO_EVENT(dev_type); u32 group = D40_TYPE_TO_GROUP(dev_type); - u32 bit = 1 << event; + u32 bit = BIT(event); u32 prioreg; struct d40_gen_dmac *dmac = &d40c->base->gen_dmac;