diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-04-11 14:48:24 +0300 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2023-05-29 23:41:29 +0900 |
commit | 93e60cd5e00e63f29e896453e10c7ede4cd8e882 (patch) | |
tree | d27dac292d8e932209753e20d9eb7b466598214c /drivers/extcon | |
parent | ef753fb4e86607afc6228d8632705122bc67f29a (diff) | |
download | linux-stable-93e60cd5e00e63f29e896453e10c7ede4cd8e882.tar.gz linux-stable-93e60cd5e00e63f29e896453e10c7ede4cd8e882.tar.bz2 linux-stable-93e60cd5e00e63f29e896453e10c7ede4cd8e882.zip |
extcon: Drop unneeded assignments
In one case the assignment is duplicative, in the other,
it's better to move it into the loop — the user of it.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r-- | drivers/extcon/extcon.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index 76dc41e8f250..6f7a60d2ed91 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -245,7 +245,7 @@ static DEFINE_MUTEX(extcon_dev_list_lock); static int check_mutually_exclusive(struct extcon_dev *edev, u32 new_state) { - int i = 0; + int i; if (!edev->mutually_exclusive) return 0; @@ -1246,7 +1246,7 @@ static int extcon_alloc_groups(struct extcon_dev *edev) */ int extcon_dev_register(struct extcon_dev *edev) { - int ret, index = 0; + int ret, index; ret = create_extcon_class(); if (ret < 0) @@ -1255,7 +1255,7 @@ int extcon_dev_register(struct extcon_dev *edev) if (!edev || !edev->supported_cable) return -EINVAL; - for (; edev->supported_cable[index] != EXTCON_NONE; index++); + for (index = 0; edev->supported_cable[index] != EXTCON_NONE; index++); edev->max_supported = index; if (index > SUPPORTED_CABLE_MAX) { |