extcon: Use BIT() macro for the left-shift operation
authorChanwoo Choi <cw00.choi@samsung.com>
Wed, 29 Mar 2017 10:18:36 +0000 (19:18 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 6 Apr 2017 02:12:45 +0000 (11:12 +0900)
This patch just uses the BIT() macro to make the code simple.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon.c

index 6817e047cd40d5e64f88f105742a1192c55a6508..f422a78ba342428c6e4da7d4bb4a15ebfcf92ec9 100644 (file)
@@ -377,7 +377,7 @@ static ssize_t state_show(struct device *dev, struct device_attribute *attr,
        for (i = 0; i < edev->max_supported; i++) {
                count += sprintf(buf + count, "%s=%d\n",
                                extcon_info[edev->supported_cable[i]].name,
-                                !!(edev->state & (1 << i)));
+                                !!(edev->state & BIT(i)));
        }
 
        return count;