[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220826120548.GA2897306@roeck-us.net>
Date: Fri, 26 Aug 2022 05:11:26 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: cgel.zte@...il.com
Cc: heikki.krogerus@...ux.intel.com, gregkh@...uxfoundation.org,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
xupanda <xu.panda@....com.cn>, Zeal Robot <zeal@....com.cn>
Subject: Re: [PATCH linux-next v2] usb: typec: tcpm: tcpci: Remove the
unneeded result variable
On Fri, Aug 26, 2022 at 09:17:32AM +0000, cgel.zte@...il.com wrote:
> From: xupanda <xu.panda@....com.cn>
>
> Return the value regmap_update_bits() directly instead of
> storing it in another redundant variable.
>
> Reported-by: Zeal Robot <zeal@....com.cn>
> Signed-off-by: xupanda <xu.panda@....com.cn>
This needs to be a real (full) name.
>
> ---
> change for v2
> - remove those irrelevant sentences
> ---
>
> drivers/usb/typec/tcpm/tcpci.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
> index b2bfcebe218f..29047da826a9 100644
> --- a/drivers/usb/typec/tcpm/tcpci.c
> +++ b/drivers/usb/typec/tcpm/tcpci.c
> @@ -328,11 +328,9 @@ static int tcpci_set_vconn(struct tcpc_dev *tcpc, bool enable)
> static int tcpci_enable_auto_vbus_discharge(struct tcpc_dev *dev, bool enable)
> {
> struct tcpci *tcpci = tcpc_to_tcpci(dev);
> - int ret;
>
> - ret = regmap_update_bits(tcpci->regmap, TCPC_POWER_CTRL, TCPC_POWER_CTRL_AUTO_DISCHARGE,
> + return regmap_update_bits(tcpci->regmap, TCPC_POWER_CTRL, TCPC_POWER_CTRL_AUTO_DISCHARGE,
> enable ? TCPC_POWER_CTRL_AUTO_DISCHARGE : 0);
Continuation line alignment still needs to be adjusted.
Both were aready mentioned in feedback to v1 of the patch.
Guenter
Powered by blists - more mailing lists