Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1615661 > unrolled thread

[PATCH v2 1/2] extcon: Use BIT() macro for the left-shift operation

Started byChanwoo Choi <cw00.choi@samsung.com>
First post2017-04-04 04:30 +0200
Last post2017-04-04 04:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 1/2] extcon: Use BIT() macro for the left-shift operation Chanwoo Choi <cw00.choi@samsung.com> - 2017-04-04 04:30 +0200

#1615661 — [PATCH v2 1/2] extcon: Use BIT() macro for the left-shift operation

FromChanwoo Choi <cw00.choi@samsung.com>
Date2017-04-04 04:30 +0200
Subject[PATCH v2 1/2] extcon: Use BIT() macro for the left-shift operation
Message-ID<tsmoh-71b-3@gated-at.bofh.it>
This patch just uses the BIT() macro to make the code simple.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
Changes from v1:
- No changes.

 drivers/extcon/extcon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index e85704eda645..193a3a673d10 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -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;
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web