From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Chou Date: Tue, 3 Nov 2015 13:21:17 +0800 Subject: [U-Boot] [PATCH 5/8] timer: altera_timer: use BIT macro In-Reply-To: <1446189498-26549-5-git-send-email-thomas@wytron.com.tw> References: <1446189498-26549-1-git-send-email-thomas@wytron.com.tw> <1446189498-26549-5-git-send-email-thomas@wytron.com.tw> Message-ID: <5638444D.6040707@wytron.com.tw> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 2015?10?30? 15:18, Thomas Chou wrote: > Replace numerical bit shift with BIT macro > in altera_timer > > :%s/(1 << nr)/BIT(nr)/g > where nr = 0, 1, 2 .... 31 > > Signed-off-by: Thomas Chou > --- > drivers/timer/altera_timer.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > Applied to u-boot-nios. > diff --git a/drivers/timer/altera_timer.c b/drivers/timer/altera_timer.c > index 2ef9ad6..288357c 100644 > --- a/drivers/timer/altera_timer.c > +++ b/drivers/timer/altera_timer.c > @@ -31,9 +31,9 @@ struct altera_timer_platdata { > }; > > /* control register */ > -#define ALTERA_TIMER_CONT (1 << 1) /* Continuous mode */ > -#define ALTERA_TIMER_START (1 << 2) /* Start timer */ > -#define ALTERA_TIMER_STOP (1 << 3) /* Stop timer */ > +#define ALTERA_TIMER_CONT BIT(1) /* Continuous mode */ > +#define ALTERA_TIMER_START BIT(2) /* Start timer */ > +#define ALTERA_TIMER_STOP BIT(3) /* Stop timer */ > > static int altera_timer_get_count(struct udevice *dev, unsigned long *count) > { >