All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
Cc: manishc@marvell.com, GR-Linux-NIC-Dev@marvell.com,
	gregkh@linuxfoundation.org, outreachy-kernel@googlegroups.com
Subject: Re: [PATCH 4/4] [Outreachy kernel] staging: qlge: qlge_ethtool.c: remove an unneeded variable
Date: Wed, 11 Mar 2020 13:08:07 +0100	[thread overview]
Message-ID: <20200311130807.02e32fc8@elisabeth> (raw)
In-Reply-To: <cf99101e09f79788fd87ad9ed455c5ef363b261f.1583918265.git.payalskshirsagar1234@gmail.com>

On Wed, 11 Mar 2020 14:58:15 +0530
Payal Kshirsagar <payalskshirsagar1234@gmail.com> wrote:

> Remove unneeded temporary local variable, cleanup suggested by coccinelle.
> 
> Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
> ---
>  drivers/staging/qlge/qlge_ethtool.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/qlge/qlge_ethtool.c b/drivers/staging/qlge/qlge_ethtool.c
> index 592ca7edfc44..e15f9723b5c0 100644
> --- a/drivers/staging/qlge/qlge_ethtool.c
> +++ b/drivers/staging/qlge/qlge_ethtool.c
> @@ -692,7 +692,6 @@ static int ql_set_pauseparam(struct net_device *netdev,
>  			     struct ethtool_pauseparam *pause)
>  {
>  	struct ql_adapter *qdev = netdev_priv(netdev);
> -	int status = 0;
>  
>  	if ((pause->rx_pause) && (pause->tx_pause))
>  		qdev->link_config |= CFG_PAUSE_STD;
> @@ -700,9 +699,7 @@ static int ql_set_pauseparam(struct net_device *netdev,
>  		qdev->link_config &= ~CFG_PAUSE_STD;
>  	else
>  		return -EINVAL;
> -
> -	status = ql_mb_set_port_cfg(qdev);
> -	return status;
> +	return ql_mb_set_port_cfg(qdev);

Here, you're also removing a newline that is typically inserted before
a second return (or the last one in a function) for readability, or
whenever there are two logically distinct branches, same in 3/4.

And in 1/4, you might want to add one. In 2/4, there's no need.

-- 
Stefano



  reply	other threads:[~2020-03-11 12:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11  9:28 [PATCH 0/4] [Outreachy kernel] staging: qlge: remove unneeded variables Payal Kshirsagar
2020-03-11  9:28 ` [PATCH 1/4] [Outreachy kernel] staging: qlge: qlge_main.c: remove an unneeded variable Payal Kshirsagar
2020-03-11  9:28 ` [PATCH 2/4] [Outreachy kernel] staging: qlge: qlge_mpi.c: " Payal Kshirsagar
2020-03-11  9:28 ` [PATCH 3/4] [Outreachy kernel] staging: qlge: qlge_dbg.c: " Payal Kshirsagar
2020-03-11  9:28 ` [PATCH 4/4] [Outreachy kernel] staging: qlge: qlge_ethtool.c: " Payal Kshirsagar
2020-03-11 12:08   ` Stefano Brivio [this message]
2020-03-11 12:20     ` Payal Kshirsagar
2020-03-11 12:44       ` Stefano Brivio
2020-03-11 13:46         ` Payal Kshirsagar
2020-03-11 14:31           ` Stefano Brivio
2020-03-11 14:44             ` Payal Kshirsagar
2020-03-11 15:07               ` Julia Lawall
2020-03-11 15:52                 ` Payal Kshirsagar
2020-03-11 16:48                   ` Stefano Brivio
2020-03-11 17:19                   ` Payal Kshirsagar
2020-03-11 20:31                     ` Julia Lawall
2020-03-11 23:12                       ` Stefano Brivio

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=20200311130807.02e32fc8@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=GR-Linux-NIC-Dev@marvell.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=manishc@marvell.com \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=payalskshirsagar1234@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.