[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130418104338.GM14496@n2100.arm.linux.org.uk>
Date: Thu, 18 Apr 2013 11:43:38 +0100
From: Russell King - ARM Linux <linux@....linux.org.uk>
To: Lee Jones <lee.jones@...aro.org>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Rabin Vincent <rabin@....in>, linus.walleij@...ricsson.com,
arnd@...db.de, Vinod Koul <vinod.koul@...el.com>,
Per Forlin <per.forlin@...ricsson.com>,
Dan Williams <djbw@...com>
Subject: Re: [PATCH 03/32] dmaengine: ste_dma40: Use the BIT macro to
replace ugly '(1 << x)'s
On Thu, Apr 18, 2013 at 11:11:45AM +0100, Lee Jones wrote:
> The aim is to make the code that little more readable.
Maybe we should also invent the MULT() macro too, because a * b is just
too ugly as well? Maybe ADD(), SUB() and DIV() macros as well... Think
of all those extra parens you could use! :)
> @@ -1448,7 +1448,7 @@ static u32 d40_residue(struct d40_chan *d40c)
> >> D40_SREG_ELEM_PHY_ECNT_POS;
> }
>
> - return num_elt * (1 << d40c->dma_cfg.dst_info.data_width);
> + return num_elt * BIT(d40c->dma_cfg.dst_info.data_width);
This should be:
return num_elt << d40c->dma_cfg.dst_info.data_width;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists