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


Groups > linux.kernel > #1612721

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

From Chanwoo Choi <cw00.choi@samsung.com>
Newsgroups linux.kernel
Subject [PATCH 1/2] extcon: Use BIT() macro for the left-shift operation
Date 2017-03-30 10:40 +0200
Message-ID <tqDMB-3Bj-3@gated-at.bofh.it> (permalink)
References <tqDMB-3Bj-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 | 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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] extcon: Use BIT() macro for the left-shift operation Chanwoo Choi <cw00.choi@samsung.com> - 2017-03-30 10:40 +0200
  [PATCH 2/2] extcon: Add new extcon_register_notifier_all() to monitor  all external connectors Chanwoo Choi <cw00.choi@samsung.com> - 2017-03-30 10:50 +0200
    Re: [PATCH 2/2] extcon: Add new extcon_register_notifier_all() to  monitor all external connectors Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-30 11:10 +0200
      Re: [PATCH 2/2] extcon: Add new extcon_register_notifier_all() to  monitor all external connectors Chanwoo Choi <cw00.choi@samsung.com> - 2017-03-30 11:30 +0200
        Re: [PATCH 2/2] extcon: Add new extcon_register_notifier_all() to  monitor all external connectors Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-30 12:50 +0200
          Re: [PATCH 2/2] extcon: Add new extcon_register_notifier_all() to  monitor all external connectors Chanwoo Choi <cw00.choi@samsung.com> - 2017-03-30 13:00 +0200
            Re: [PATCH 2/2] extcon: Add new extcon_register_notifier_all() to  monitor all external connectors Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-30 13:10 +0200
    Re: [PATCH 2/2] extcon: Add new extcon_register_notifier_all() to  monitor all external connectors Hans de Goede <hdegoede@redhat.com> - 2017-03-30 11:20 +0200
      Re: [PATCH 2/2] extcon: Add new extcon_register_notifier_all() to  monitor all external connectors Chanwoo Choi <cw00.choi@samsung.com> - 2017-03-30 11:30 +0200
        Re: [PATCH 2/2] extcon: Add new extcon_register_notifier_all() to  monitor all external connectors Hans de Goede <hdegoede@redhat.com> - 2017-03-30 17:00 +0200
          Re: [PATCH 2/2] extcon: Add new extcon_register_notifier_all() to  monitor all external connectors Chanwoo Choi <cw00.choi@samsung.com> - 2017-04-03 09:30 +0200
            Re: [PATCH 2/2] extcon: Add new extcon_register_notifier_all() to  monitor all external connectors Hans de Goede <hdegoede@redhat.com> - 2017-04-03 13:20 +0200
              Re: [PATCH 2/2] extcon: Add new extcon_register_notifier_all() to  monitor all external connectors Chanwoo Choi <cw00.choi@samsung.com> - 2017-04-04 07:00 +0200
              Re: [PATCH 2/2] extcon: Add new extcon_register_notifier_all() to  monitor all external connectors Hans de Goede <hdegoede@redhat.com> - 2017-04-04 12:50 +0200
                Re: [PATCH 2/2] extcon: Add new extcon_register_notifier_all() to  monitor all external connectors Chanwoo Choi <cw00.choi@samsung.com> - 2017-04-04 13:00 +0200
  Re: [PATCH 1/2] extcon: Use BIT() macro for the left-shift operation Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-30 11:10 +0200
    Re: [PATCH 1/2] extcon: Use BIT() macro for the left-shift operation Chanwoo Choi <cw00.choi@samsung.com> - 2017-03-30 11:20 +0200
      Re: [PATCH 1/2] extcon: Use BIT() macro for the left-shift operation Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-30 12:40 +0200
        Re: [PATCH 1/2] extcon: Use BIT() macro for the left-shift  operation Chanwoo Choi <cw00.choi@samsung.com> - 2017-03-30 13:00 +0200
          Re: [PATCH 1/2] extcon: Use BIT() macro for the left-shift operation Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-30 13:20 +0200

csiph-web