Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3447398pxa; Wed, 26 Aug 2020 00:00:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5E+AG+p0pOp5l/yySKKVgJxceJVdGpizBkNsOJo+mDP8RefcysqhJDtO6O3ngZwohukMl X-Received: by 2002:aa7:cb45:: with SMTP id w5mr13652360edt.77.1598425258450; Wed, 26 Aug 2020 00:00:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598425258; cv=none; d=google.com; s=arc-20160816; b=tedvbhtWEo6tHQEAAlkuPyuCP2jjJPo+0i6QHP1M3whA0JsShKBOO9V/oCKHCD0d98 CgiubmDb7GlH6bjuPwtYV1ZPx0YTATZIhbbDWBQsDFDlxuD7FsJ8kYM10F3excBo6rez N0F2i9YEHqoloctSkCTDb271RwLc/61dSDFhz0ONMEjUH99RbQeyOvuvR2NGck2JVVIT jNvc1GuZ6Y3u7ehhA1h7FO6hKj2OaMZBuvEXy7+u6OQGh2ZJUEGXomrXFFDxMRlkrRl8 fy0kvMeKcoostukMYxK8XGOmQ6HfZaLHpA1ORHZhT5QREQC5bPsQOI0mNF8vtQ6uHimY uR0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=LsFhoOeroVCTGv0q4/82tJt3Y+47dDgfCwFCYURdTmM=; b=QPQtMrWLNDu3wh0R+DxPLn6DnN68JYR8dK/eoE9xj3vq8HEy6TfKiF+kzCvQ2Xt7Fl xLmPKXxes453gQdAykRJaPZDRxP4ziIV05SIiqza5R5I+BkBYZ0WwdLULy+sKngsI4Mc 6ekmk0vLHrUov6SrU1lA2pSfuWABnXO8jpOJsynDN4ACoye8stCtX6zjphMGdBQPCERv ImqRURklhH0DMXV9wy+1Sk6wZfcFXqCUjUoc4tqsOaK9+uMUkRebxlFK3yDohWzz/wnB JR5zN3SDMD7BHrCAFuYkdPEflkGmDr6s4XRLBMuRwRKZD1LtzNbzl6TF2ppdWz+oSnZ2 d1mw== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g24si1029701ejh.325.2020.08.26.00.00.34; Wed, 26 Aug 2020 00:00:58 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726716AbgHZG70 (ORCPT + 99 others); Wed, 26 Aug 2020 02:59:26 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:36266 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726233AbgHZG7Z (ORCPT ); Wed, 26 Aug 2020 02:59:25 -0400 Received: by mail-wm1-f66.google.com with SMTP id z9so649202wmk.1 for ; Tue, 25 Aug 2020 23:59:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=LsFhoOeroVCTGv0q4/82tJt3Y+47dDgfCwFCYURdTmM=; b=d5niNRXm3RiAzHBuiur6oWXheJa7TpEPWwY9fnUKqZDcX9tCJlSrpBFgM3nBHZt2cN Jw07/TiQV8fM+RMS6icwo6XWX2OZyrFsmwPM701X5j74lnPBf0Ldum1t5Z5aswO9ZwMe 5eewE031ETsEGwRBH0kxLDW9Dz7IAzd8TWIViIhV071jkOfxztMQeMELEjl9QbdGrnhh 0qcj808gN8L8XeI+nIVOEe36jJLHAv0+13gpLFLp0E6MHulWdcrQSUDd20P8eGJlKylE +oc45T3qEp3OmPo7PXYOnU+qQMkaCelggvhn4hiAD7ABFuJYzeeJmVjAan9vQWA+Ugk/ 4L+g== X-Gm-Message-State: AOAM532nOMUw0VVFnemSYpkj+A4JH2TLEQSE9Zxhu4v+3DcChojBN1a1 286B9nuC4QunYAqqJo5H0r3kacQ7rZk= X-Received: by 2002:a1c:a70c:: with SMTP id q12mr5542296wme.89.1598425163265; Tue, 25 Aug 2020 23:59:23 -0700 (PDT) Received: from pi3 ([194.230.155.216]) by smtp.googlemail.com with ESMTPSA id q5sm3565928wrp.60.2020.08.25.23.59.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 23:59:22 -0700 (PDT) Date: Wed, 26 Aug 2020 08:59:20 +0200 From: Krzysztof Kozlowski To: "Ramuthevar,Vadivel MuruganX" 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 Subject: Re: [PATCH v1 2/9] extcon: extcon-ptn5150: Switch to GENMASK() for VBUS detection macro Message-ID: <20200826065920.GB12271@pi3> References: <20200818065727.50520-1-vadivel.muruganx.ramuthevar@linux.intel.com> <20200818065727.50520-3-vadivel.muruganx.ramuthevar@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200818065727.50520-3-vadivel.muruganx.ramuthevar@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 >