Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3464984pxa; Wed, 26 Aug 2020 00:37:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybFQxNmgt/s85rbHtAeDICv6VqQIWYrsWWQ61w6zLOTyBC87BF9f5Er0t1svcQRcFi5dxx X-Received: by 2002:a17:906:2289:: with SMTP id p9mr14306349eja.437.1598427440538; Wed, 26 Aug 2020 00:37:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598427440; cv=none; d=google.com; s=arc-20160816; b=neAkKhe9rB5z2xvMNnyTarBe16C3Fz5b1u8BHu3Ja7DhRkwddD1zj/ydL8ka1n03E+ mN9TJ/x32AyxRiEjjswY65owhSuur7YKRgIZrp+qDE7V+GRhRI64MXm3eGtRYqQ3jv9K 4FOWPiEhM2wJEE9aai91p0WVjfc5XMzKDeULLr0Q5JEMibQqf+UgLDg36k/Hl8gDALHV kflQyS7w7KgDn38qUf4kIYniXiSiH4f2ZmHpDTEj/d/2R87fE131ojERCdIeN4dw3C1u IwFbXuKW6tsd1JSziibt1ATc+Uclp1aNgoCHFIxdeA6Bh3zbzaGQ/3BH6y+wYnE/ZJTJ VqIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to:ironport-sdr :ironport-sdr; bh=gWntvobH+TrWK7Iv7PsPKKYpQdBSO0swLO6IJcfpuIk=; b=txmBVRsvv1ZEwkCI69mO0CN0E23YLP8DcWSr3BW2h/q/ZKdX99LERtbhgnfvfctOjx VojMG/BrpvHZY8GFSdxTLALORTp7ejyIUbEyp9n3dUpvWcEbQsDwnHJNwn37ontCl9G1 nhBTPrL520xNQHyrRLHRLeEc90YihaZPl54bw0lTXRY/Ci/Ft3/l0Y5zgc2Qjv9gnaYV RrJ84nUwmP+S0aB7C1DF4LBlUS5ftBJjbnuEXFf75v8hPhqB5GUQSgAdD1hAVncEuBa+ 7HsX4JWfS4Y7Yhtyf3/IqIuH8ANyIzcVRRDGMLLvNlcTOZg/2TYkgg6WFt1cl+g0bVcf CB3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b92si929934edf.226.2020.08.26.00.36.56; Wed, 26 Aug 2020 00:37:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726723AbgHZHeC (ORCPT + 99 others); Wed, 26 Aug 2020 03:34:02 -0400 Received: from mga04.intel.com ([192.55.52.120]:39982 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbgHZHeC (ORCPT ); Wed, 26 Aug 2020 03:34:02 -0400 IronPort-SDR: 0GafeSFbd2fPtfcu0y/EvUpmiwBOQchHPdbaWgNbaFwMHm/RSs9aiMrdRm9SDqqiM65Ox2xiXj p3EXs9Quf7WQ== X-IronPort-AV: E=McAfee;i="6000,8403,9724"; a="153671790" X-IronPort-AV: E=Sophos;i="5.76,354,1592895600"; d="scan'208";a="153671790" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2020 00:34:00 -0700 IronPort-SDR: KsKT0zQOlKI9ZRXe9nwwNG+Znb7WuamKHzseJep0AJhFaxdyjy1ipUOn6FK/RGr1LeijjSvGn1 wWBgT+MsGYCg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,354,1592895600"; d="scan'208";a="323089632" Received: from linux.intel.com ([10.54.29.200]) by fmsmga004.fm.intel.com with ESMTP; 26 Aug 2020 00:34:00 -0700 Received: from [10.215.173.55] (vramuthx-MOBL1.gar.corp.intel.com [10.215.173.55]) by linux.intel.com (Postfix) with ESMTP id D75A6580821; Wed, 26 Aug 2020 00:33:56 -0700 (PDT) Reply-To: vadivel.muruganx.ramuthevar@linux.intel.com Subject: Re: [PATCH v1 2/9] extcon: extcon-ptn5150: Switch to GENMASK() for VBUS detection macro To: Krzysztof Kozlowski Cc: linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, cw00.choi@samsung.com, andriy.shevchenko@intel.com, thomas.langer@intel.com, cheol.yong.kim@intel.com, qi-ming.wu@intel.com, yin1.li@intel.com, Heikki Krogerus References: <20200818065727.50520-1-vadivel.muruganx.ramuthevar@linux.intel.com> <20200818065727.50520-3-vadivel.muruganx.ramuthevar@linux.intel.com> <20200826065920.GB12271@pi3> From: "Ramuthevar, Vadivel MuruganX" Message-ID: Date: Wed, 26 Aug 2020 15:33:54 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200826065920.GB12271@pi3> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 26/8/2020 2:59 pm, Krzysztof Kozlowski wrote: > On Tue, Aug 18, 2020 at 02:57:20PM +0800, Ramuthevar,Vadivel MuruganX wrote: >> From: Ramuthevar Vadivel Murugan >> >> Switch to GENMASK() for VBUS detection macro. >> >> Signed-off-by: Ramuthevar Vadivel Murugan >> --- >> drivers/extcon/extcon-ptn5150.c | 9 +++------ >> 1 file changed, 3 insertions(+), 6 deletions(-) > > This is too simple change, should be squashed with 1, 3, 4 and 5. > > There is no point to split each change a define to use BIT or GENMASK. Thank you for the review comments and suggestions. Sure, I will squash it as mentioned patches mentioned above. Best Regards Vadivel > > Best regards, > Krzysztof > >> >> diff --git a/drivers/extcon/extcon-ptn5150.c b/drivers/extcon/extcon-ptn5150.c >> index 5d9a8767646b..c816a6c1e05c 100644 >> --- a/drivers/extcon/extcon-ptn5150.c >> +++ b/drivers/extcon/extcon-ptn5150.c >> @@ -42,9 +42,7 @@ enum ptn5150_reg { >> #define PTN5150_REG_CC_PORT_ATTACHMENT_MASK \ >> (0x7 << PTN5150_REG_CC_PORT_ATTACHMENT_SHIFT) >> >> -#define PTN5150_REG_CC_VBUS_DETECTION_SHIFT 7 >> -#define PTN5150_REG_CC_VBUS_DETECTION_MASK \ >> - (0x1 << PTN5150_REG_CC_VBUS_DETECTION_SHIFT) >> +#define PTN5150_REG_CC_VBUS_DETECTION BIT(7) >> >> #define PTN5150_REG_INT_CABLE_ATTACH_SHIFT 0 >> #define PTN5150_REG_INT_CABLE_ATTACH_MASK \ >> @@ -130,9 +128,8 @@ static void ptn5150_irq_work(struct work_struct *work) >> case PTN5150_UFP_ATTACHED: >> extcon_set_state_sync(info->edev, EXTCON_USB, >> false); >> - vbus = ((reg_data & >> - PTN5150_REG_CC_VBUS_DETECTION_MASK) >> >> - PTN5150_REG_CC_VBUS_DETECTION_SHIFT); >> + vbus = FIELD_GET(PTN5150_REG_CC_VBUS_DETECTION, >> + reg_data); >> if (vbus) >> gpiod_set_value(info->vbus_gpiod, 0); >> else >> -- >> 2.11.0 >>