Skip to content

Commit 93e60cd

Browse files
andy-shevchanwoochoi
authored andcommitted
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>
1 parent ef753fb commit 93e60cd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/extcon/extcon.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static DEFINE_MUTEX(extcon_dev_list_lock);
245245

246246
static int check_mutually_exclusive(struct extcon_dev *edev, u32 new_state)
247247
{
248-
int i = 0;
248+
int i;
249249

250250
if (!edev->mutually_exclusive)
251251
return 0;
@@ -1246,7 +1246,7 @@ static int extcon_alloc_groups(struct extcon_dev *edev)
12461246
*/
12471247
int extcon_dev_register(struct extcon_dev *edev)
12481248
{
1249-
int ret, index = 0;
1249+
int ret, index;
12501250

12511251
ret = create_extcon_class();
12521252
if (ret < 0)
@@ -1255,7 +1255,7 @@ int extcon_dev_register(struct extcon_dev *edev)
12551255
if (!edev || !edev->supported_cable)
12561256
return -EINVAL;
12571257

1258-
for (; edev->supported_cable[index] != EXTCON_NONE; index++);
1258+
for (index = 0; edev->supported_cable[index] != EXTCON_NONE; index++);
12591259

12601260
edev->max_supported = index;
12611261
if (index > SUPPORTED_CABLE_MAX) {

0 commit comments

Comments
 (0)