Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3449246pxa; Wed, 26 Aug 2020 00:04:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1/tyDodrkkOmrxDQ9bgueIL8ZfixF+IryqEk4MXcd6lMfCITAJWyqgavYleYDzmF1N12b X-Received: by 2002:aa7:dc08:: with SMTP id b8mr5468073edu.271.1598425447582; Wed, 26 Aug 2020 00:04:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598425447; cv=none; d=google.com; s=arc-20160816; b=C6AaVSZTtMaPjdFk/QzVP17SeUzhJKoj4dikZy37P1ZnnZYFF/jOnRGOvPjcuMUsnx 5g8IQ2C9u8bnGNbMjYHhs2SzlThpbJksB+boiXbovcsheJxJ2NsYam7hPnyGxdI5APtl YeCGG35zv+OvO4EE8pqJiikW/ShKd7nmLGi0hzLgDfdDb/qxIj95fm/8WWHSEeMGyOZa T7kMT2/tPzfpJ+QmHztfO+bRxUpJHSz0inHxq1wPBARxdzA0hBuisck+T8+fn+BuFeJW lBfdgY0oDtxiN8qLzCMWvz/ZgpCM/123hCYoL0XZXFfJ1rsINQgFxAFa9TCYv+g240gx 2VFA== 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=RHWmtyQkL2Gd7DQBgRTCb7zJvVv0AbfFavH+YrU+dDE=; b=f+4qjps3wwMbLuAXX0apbycmLIfEsXqLYJzFIg03wKv3AWuXKuuOdnwzItI0k1oTwR Hyn6+PTcFW66hszddIFfzgcObDhPIueMUzyS3ZQ6wFSpIKzaRuP5fQlEhTpGcACJeL5F lMMXqKZAYAtGKCnrI7q69Ne5IxgqPhQ5VPqgFB3jwNQfnjfAvK7BjUlcsyVgoPxAaxBY 2O2X2lS6dt4ENXmy/G8fIBIBw/AWo7GQuuXkUzqWFzhTlAysU8y/+4PEJQ3PU8zuEW8d 1mU3JlHSk3Kks4TiAmgnNg4WB0VL4umRHxIyRhJ2HYeJqWp2DImm/OsTZgqcDHEXHURb QIAg== 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 u19si901449edt.139.2020.08.26.00.03.44; Wed, 26 Aug 2020 00:04:07 -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 S1726707AbgHZHCL (ORCPT + 99 others); Wed, 26 Aug 2020 03:02:11 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44414 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726875AbgHZHAk (ORCPT ); Wed, 26 Aug 2020 03:00:40 -0400 Received: by mail-wr1-f68.google.com with SMTP id c15so620126wrs.11 for ; Wed, 26 Aug 2020 00:00:39 -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=RHWmtyQkL2Gd7DQBgRTCb7zJvVv0AbfFavH+YrU+dDE=; b=k94ZV2KI5xbc/l5DBwfp4ArwcBaJJqFNQ5rMqDeBm7JqsWetwF8gKA4I90Ez3MYHks weWQeygbA6GQp+krrJcOLP9gRxvOZDfPDLc9diqC28Y3/6bypvYVZki9qr5jjykIVGaF qWkoQQ1zVQNVY5fGPVm7YSxx/g5ZYliv3ITl5aiaGVUudSZKl3C89WrqzY8y6Jt2bSNI OCTi2St4hPoABFCw8GjOB2RfGKYQE+tWFE5FLvyadVAL5v/U45P7cZPQ03B9RDz1xcMn 2stYjr3u7Ry3VLKCfTZcx3PeRorcCBTwyynrVfdCgJaDx81IF+ovrYzx2H6U9HqNGWPL pdEg== X-Gm-Message-State: AOAM532n54Dtt4CME9nLECNmfshJRLubZu1x80fHXXouZx7YXPIUxIot 6WUGa9iUMvQ54Znr4UA81Oc= X-Received: by 2002:adf:f289:: with SMTP id k9mr14252752wro.203.1598425238303; Wed, 26 Aug 2020 00:00:38 -0700 (PDT) Received: from pi3 ([194.230.155.216]) by smtp.googlemail.com with ESMTPSA id z6sm3079983wml.41.2020.08.26.00.00.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 00:00:37 -0700 (PDT) Date: Wed, 26 Aug 2020 09:00:35 +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 5/9] extcon: extcon-ptn5150: Switch to GENMASK() for port attachment macro Message-ID: <20200826070035.GE12271@pi3> References: <20200818065727.50520-1-vadivel.muruganx.ramuthevar@linux.intel.com> <20200818065727.50520-6-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-6-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:23PM +0800, Ramuthevar,Vadivel MuruganX wrote: > From: Ramuthevar Vadivel Murugan > > Switch to GENMASK() macro for the port attachment. Squash it. Best regards, Krzysztof > > Signed-off-by: Ramuthevar Vadivel Murugan > --- > drivers/extcon/extcon-ptn5150.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/drivers/extcon/extcon-ptn5150.c b/drivers/extcon/extcon-ptn5150.c > index 50fff148b772..31b7cbf1551d 100644 > --- a/drivers/extcon/extcon-ptn5150.c > +++ b/drivers/extcon/extcon-ptn5150.c > @@ -38,9 +38,7 @@ enum ptn5150_reg { > #define PTN5150_REG_DEVICE_ID_VERSION GENMASK(7, 3) > #define PTN5150_REG_DEVICE_ID_VENDOR GENMASK(2, 0) > > -#define PTN5150_REG_CC_PORT_ATTACHMENT_SHIFT 2 > -#define PTN5150_REG_CC_PORT_ATTACHMENT_MASK \ > - (0x7 << PTN5150_REG_CC_PORT_ATTACHMENT_SHIFT) > +#define PTN5150_REG_CC_PORT_ATTACHMENT GENMASK(4, 2) > > #define PTN5150_REG_CC_VBUS_DETECTION BIT(7) > > @@ -108,9 +106,8 @@ static void ptn5150_irq_work(struct work_struct *work) > unsigned int port_status; > unsigned int vbus; > > - port_status = ((reg_data & > - PTN5150_REG_CC_PORT_ATTACHMENT_MASK) >> > - PTN5150_REG_CC_PORT_ATTACHMENT_SHIFT); > + port_status = FIELD_GET(PTN5150_REG_CC_PORT_ATTACHMENT, > + reg_data); > > switch (port_status) { > case PTN5150_DFP_ATTACHED: > -- > 2.11.0 >