Message ID | 20230322144005.40368-14-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2384393wrt; Wed, 22 Mar 2023 07:54:58 -0700 (PDT) X-Google-Smtp-Source: AK7set8+gMCQLWFf8sBBhEO+duqZJ64DkuwZrIddvU9/iIrXtJw3CKpRdn0UpjeDWbw6SWJZ+0Ov X-Received: by 2002:a17:902:f548:b0:1a1:b238:d1ab with SMTP id h8-20020a170902f54800b001a1b238d1abmr3464162plf.69.1679496898604; Wed, 22 Mar 2023 07:54:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679496898; cv=none; d=google.com; s=arc-20160816; b=Ax+j4fzW3emQDKqc/nVski+IcToZEu82Mke6co+HlfE7IDXu/zj9cCINlUKlXe89AL xztql0XrX3UVeT8xfq6Nn/66atuZUkQyiO/pOmpYEmsYgOefvOXERl1pNlG9UyNFN16L 4VH2RN3tdJDYAFamNy4tR5uU2Tm903invxC8gpvq13XJUnWnk/bKZXTNEiaeBW+inEwQ 7yRGqxH5TCnGwXellijDd0BlNbTiBPipGguA6U1VI9qVOApEyb02snu0g3Ag4v8hO1gS ctD2qV+E090VmVXzk2OVRC+04udDfzmdgQYJpaDmpr+4CK5HFqaEt8VWohUoUIjENhBf ttmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SGiLeqHuw9hxmjqRqoh2WDTqMd6N0Pr4/Pdz6e/8Q3I=; b=r2k4o2xYwq5ZL936S0ycOuN/GguWW8JI6zZy0HtrcnYE3s8VrAD/ea8dO8JOD2CmDO wRfVmUCeC6pEpgkVsHRYJPsLaYQ4Vwn3dXWO24iJmjkXESBgYW+gqAxXyfh9j5ZEtxxC Kt5SBhQV7So60svad9qo59RhfltvGJORkXFwICvmtqWQHfaoi1chaStimz9Hlv2l/ho9 CwYMc48+R/KhFHTIvD9WF9Oy4A3LOin10sB5B5pt7xBmvW0IyePYTVN6x2bpW+SEnl2M i7YwoyZ9w4gqOcJGDs9CZKqf4sAO84oky/Rl0E4YEZ4xSZoX+Vt/vLY7FvuODUoJCvSm Qqaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YowXbGbE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i10-20020a63cd0a000000b00507281fb21fsi16255279pgg.557.2023.03.22.07.54.45; Wed, 22 Mar 2023 07:54:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YowXbGbE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231833AbjCVOj5 (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Wed, 22 Mar 2023 10:39:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231539AbjCVOj0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 22 Mar 2023 10:39:26 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE7B454C8D for <linux-kernel@vger.kernel.org>; Wed, 22 Mar 2023 07:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679495965; x=1711031965; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hoaAx9Ps+XUntb1eapTod1FMgNK7hAJfzIEXEA74T44=; b=YowXbGbEuwMX3f3a+dXoyeNhKZCY7RyzQ84gWM0B3rFMryNud0dY9XJD enltDkzUTVghWNzucsQ1nZZV9DXJTunY86/LCQAzZrPFssxp34j8BtYSP hprXPEsKev+DVovGO/SlklR0zO/7IcymTWTRbeTsSZvWDAYHM6256Ojf+ /mstvdtC3W7Siwh12wClIz8mL1zcldGBrabwD8h6LURdVEkudilGoFmVE ouhNNpuLp5edowb929o/ljdq9PH+4qxgMuod07GjqFQ+Let8X63LznfAe Zr08nYBufeFUct0RFY+usN+7ulDQVaC+YSGYyjGBWpYaPCc9N6yebTsdm g==; X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="319622128" X-IronPort-AV: E=Sophos;i="5.98,282,1673942400"; d="scan'208";a="319622128" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2023 07:39:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="856116428" X-IronPort-AV: E=Sophos;i="5.98,282,1673942400"; d="scan'208";a="856116428" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 22 Mar 2023 07:39:23 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 11EC0A53; Wed, 22 Mar 2023 16:40:07 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Bumwoo Lee <bw365.lee@samsung.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, linux-kernel@vger.kernel.org Cc: MyungJoo Ham <myungjoo.ham@samsung.com>, Chanwoo Choi <cw00.choi@samsung.com> Subject: [PATCH v1 13/14] extcon: Drop unneeded assignments Date: Wed, 22 Mar 2023 16:40:04 +0200 Message-Id: <20230322144005.40368-14-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230322144005.40368-1-andriy.shevchenko@linux.intel.com> References: <20230322144005.40368-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761080139965270756?= X-GMAIL-MSGID: =?utf-8?q?1761080139965270756?= |
Series |
extcon: Core cleanups and documentation fixes
|
|
Commit Message
Andy Shevchenko
March 22, 2023, 2:40 p.m. UTC
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>
---
drivers/extcon/extcon.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
On 23. 3. 22. 23:40, Andy Shevchenko wrote: > 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> > --- > drivers/extcon/extcon.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c > index b3f038639cd6..edfa0450e605 100644 > --- a/drivers/extcon/extcon.c > +++ b/drivers/extcon/extcon.c > @@ -246,7 +246,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; > @@ -1244,7 +1244,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) > @@ -1253,7 +1253,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) { It has the dependency with patch7. When I try to apply it, the conflict happen. When you are sending v2 patches, I'll apply it if there are no conflict. [1] [PATCH v1 07/14] extcon: Use unique number for the extcon device ID Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index b3f038639cd6..edfa0450e605 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -246,7 +246,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; @@ -1244,7 +1244,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) @@ -1253,7 +1253,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) {