linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: "'hariprasath.elango@gmail.com'" <hariprasath.elango@gmail.com>,
	"ruxandra.radulescu@nxp.com" <ruxandra.radulescu@nxp.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "gehariprasath@gmail.com" <gehariprasath@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>
Subject: RE: [PATCH] staging: fsl-dpaa2: replace simple switch case by if statement
Date: Wed, 21 Mar 2018 11:48:08 +0000	[thread overview]
Message-ID: <faa92f0e20fc44019ee0b64b04413d69@AcuMS.aculab.com> (raw)
In-Reply-To: <20180321111604.9902-1-hariprasath.elango@gmail.com>

From: > hariprasath.elango@gmail.com
> Sent: 21 March 2018 11:16
> From: HariPrasath Elango <hariprasath.elango@gmail.com>
> 
> Replace a couple of simple switch cases by if condition

Why?
In principle extra 'case' might be needed in the future.

...
> diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c b/drivers/staging/fsl-
> dpaa2/ethernet/dpaa2-ethtool.c
> index 070a3f2..fb517cb 100644
> --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
> +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
> @@ -171,8 +171,7 @@ static void dpaa2_eth_get_strings(struct net_device *netdev, u32 stringset,
>  	u8 *p = data;
>  	int i;
> 
> -	switch (stringset) {
> -	case ETH_SS_STATS:
> +	if (stringset == ETH_SS_STATS) {
>  		for (i = 0; i < DPAA2_ETH_NUM_STATS; i++) {
>  			strlcpy(p, dpaa2_ethtool_stats[i], ETH_GSTRING_LEN);
>  			p += ETH_GSTRING_LEN;
> @@ -181,18 +180,16 @@ static void dpaa2_eth_get_strings(struct net_device *netdev, u32 stringset,
>  			strlcpy(p, dpaa2_ethtool_extras[i], ETH_GSTRING_LEN);
>  			p += ETH_GSTRING_LEN;
>  		}
> -		break;
>  	}
>  }
...

	David

  reply	other threads:[~2018-03-21 11:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-21 11:16 [PATCH] staging: fsl-dpaa2: replace simple switch case by if statement hariprasath.elango
2018-03-21 11:48 ` David Laight [this message]
2018-03-21 12:17   ` Denis Kirjanov
2018-03-21 13:05     ` <Hariprasath Elango>

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=faa92f0e20fc44019ee0b64b04413d69@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gehariprasath@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hariprasath.elango@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ruxandra.radulescu@nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).