Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: janz-ttl: Use BIT() macro

This makes the code more readable by using the BIT() macro.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

+7 -6
+7 -6
drivers/gpio/gpio-janz-ttl.c
··· 18 18 #include <linux/io.h> 19 19 #include <linux/gpio/driver.h> 20 20 #include <linux/slab.h> 21 + #include <linux/bitops.h> 21 22 22 23 #include <linux/mfd/janz.h> 23 24 ··· 34 33 #define MASTER_INT_CTL 0x00 35 34 #define MASTER_CONF_CTL 0x01 36 35 37 - #define CONF_PAE (1 << 2) 38 - #define CONF_PBE (1 << 7) 39 - #define CONF_PCE (1 << 4) 36 + #define CONF_PAE BIT(2) 37 + #define CONF_PBE BIT(7) 38 + #define CONF_PCE BIT(4) 40 39 41 40 struct ttl_control_regs { 42 41 __be16 portc; ··· 75 74 } 76 75 77 76 spin_lock(&mod->lock); 78 - ret = *shadow & (1 << offset); 77 + ret = *shadow & BIT(offset); 79 78 spin_unlock(&mod->lock); 80 79 return !!ret; 81 80 } ··· 101 100 102 101 spin_lock(&mod->lock); 103 102 if (value) 104 - *shadow |= (1 << offset); 103 + *shadow |= BIT(offset); 105 104 else 106 - *shadow &= ~(1 << offset); 105 + *shadow &= ~BIT(offset); 107 106 108 107 iowrite16be(*shadow, port); 109 108 spin_unlock(&mod->lock);