lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 21 Mar 2018 18:35:57 +0530
From:   "<Hariprasath Elango>" <hariprasath.elango@...il.com>
To:     Denis Kirjanov <kirjanov@...il.com>
Cc:     David Laight <David.Laight@...lab.com>,
        "hariprasath.elango@...il.com" <hariprasath.elango@...il.com>,
        "ruxandra.radulescu@....com" <ruxandra.radulescu@....com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging: fsl-dpaa2: replace simple switch case by if
 statement

On Wed, Mar 21, 2018 at 03:17:51PM +0300, Denis Kirjanov wrote:
> On 3/21/18, David Laight <David.Laight@...lab.com> wrote:
> > From: > hariprasath.elango@...il.com
> >> Sent: 21 March 2018 11:16
> >> From: HariPrasath Elango <hariprasath.elango@...il.com>
> >>
> >> Replace a couple of simple switch cases by if condition
> >
> > Why?
> > In principle extra 'case' might be needed in the future.
> 
> I had the same question when saw it.
> It's better to keep things as is.
> >
> > ...

 Hi, since the switch statement had only one case,I thought of doing
 this. If there are plans to add more cases, we can leave it like
 that.

 thanks,
 hari

> >> 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
> >
> > _______________________________________________
> > devel mailing list
> > devel@...uxdriverproject.org
> > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
> >
> 
> 
> -- 
> Regards / Mit besten Grüßen,
> Denis

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ