瀏覽代碼

timer: altera_timer: use BIT macro

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 <thomas@wytron.com.tw>
Reviewed-by: Jagan Teki <jteki@openedev.com>
Thomas Chou 9 年之前
父節點
當前提交
430b43e8ee
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      drivers/timer/altera_timer.c

+ 3 - 3
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)
 {