From: Greg KH <gregkh@linuxfoundation.org>
To: dingsenjie@163.com
Cc: linux@roeck-us.net, heikki.krogerus@linux.intel.com,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
dingsenjie <dingsenjie@yulong.com>
Subject: Re: [PATCH] usb: tcpm: Simplify the return expression of tcpm_start_toggling
Date: Fri, 22 Oct 2021 13:47:21 +0200 [thread overview]
Message-ID: <YXKkyRGoH+UJzIFw@kroah.com> (raw)
In-Reply-To: <20211022110045.11044-1-dingsenjie@163.com>
On Fri, Oct 22, 2021 at 07:00:45PM +0800, dingsenjie@163.com wrote:
> From: dingsenjie <dingsenjie@yulong.com>
>
> Simplify the return expression in the tcpm.c
Why?
>
> Signed-off-by: dingsenjie <dingsenjie@yulong.com>
Is this the full name you sign legal documents with? (I have to ask...)
> ---
> drivers/usb/typec/tcpm/tcpm.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 22a85b396f69..dabe694a7eb1 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -2766,14 +2766,11 @@ static int tcpm_set_charge(struct tcpm_port *port, bool charge)
>
> static bool tcpm_start_toggling(struct tcpm_port *port, enum typec_cc_status cc)
> {
> - int ret;
> -
> if (!port->tcpc->start_toggling)
> return false;
>
> tcpm_log_force(port, "Start toggling");
> - ret = port->tcpc->start_toggling(port->tcpc, port->port_type, cc);
> - return ret == 0;
> + return port->tcpc->start_toggling(port->tcpc, port->port_type, cc) == 0;
Why change this from the original code? The original code is easier to
read, right?
thanks,
greg k-h
prev parent reply other threads:[~2021-10-22 11:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-22 11:00 [PATCH] usb: tcpm: Simplify the return expression of tcpm_start_toggling dingsenjie
2021-10-22 11:47 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YXKkyRGoH+UJzIFw@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=dingsenjie@163.com \
--cc=dingsenjie@yulong.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox