[net-next] net: dpaa: change while() to if() in dpaa_fq_setup()

Message ID 1515834954-32145-1-git-send-email-cugyly@163.com
State Rejected
Delegated to: David Miller
Headers show
Series
  • [net-next] net: dpaa: change while() to if() in dpaa_fq_setup()
Related show

Commit Message

yuan linyu Jan. 13, 2018, 9:15 a.m.
From: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>

while loop is not needed, because list_for_each_entry() already check all fq.

Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
---
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

yuan linyu Jan. 13, 2018, 9:24 a.m. | #1
i am wrong, ignore it.

On 六, 2018-01-13 at 17:15 +0800, yuan linyu wrote:
> From: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
> 
> while loop is not needed, because list_for_each_entry() already check all fq.
> 
> Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
> ---
>  drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> index 7caa8da..fd0e411 100644
> --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> @@ -931,7 +931,7 @@ static void dpaa_fq_setup(struct dpaa_priv *priv,
>  	}
>  
>  	 /* Make sure all CPUs receive a corresponding Tx queue. */
> -	while (egress_cnt < DPAA_ETH_TXQ_NUM) {
> +	if (egress_cnt < DPAA_ETH_TXQ_NUM) {
>  		list_for_each_entry(fq, &priv->dpaa_fq_list, list) {
>  			if (fq->fq_type != FQ_TYPE_TX)
>  				continue;
Madalin-cristian Bucur Jan. 15, 2018, 9:32 a.m. | #2
> -----Original Message-----

> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]

> On Behalf Of yuan linyu

> Sent: Saturday, January 13, 2018 11:25 AM

> To: netdev@vger.kernel.org

> Cc: David S . Miller <davem@davemloft.net>; yuan linyu

> <Linyu.Yuan@alcatel-sbell.com.cn>

> Subject: Re: [PATCH net-next] net: dpaa: change while() to if() in

> dpaa_fq_setup()

> 

> i am wrong, ignore it.

> 


Yes, the wile is required.

Madalin

> On 六, 2018-01-13 at 17:15 +0800, yuan linyu wrote:

> > From: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>

> >

> > while loop is not needed, because list_for_each_entry() already check

> all fq.

> >

> > Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>

> > ---

> >  drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-

> >  1 file changed, 1 insertion(+), 1 deletion(-)

> >

> > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

> b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

> > index 7caa8da..fd0e411 100644

> > --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

> > +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

> > @@ -931,7 +931,7 @@ static void dpaa_fq_setup(struct dpaa_priv *priv,

> >  	}

> >

> >  	 /* Make sure all CPUs receive a corresponding Tx queue. */

> > -	while (egress_cnt < DPAA_ETH_TXQ_NUM) {

> > +	if (egress_cnt < DPAA_ETH_TXQ_NUM) {

> >  		list_for_each_entry(fq, &priv->dpaa_fq_list, list) {

> >  			if (fq->fq_type != FQ_TYPE_TX)

> >  				continue;

Patch

diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index 7caa8da..fd0e411 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -931,7 +931,7 @@  static void dpaa_fq_setup(struct dpaa_priv *priv,
 	}
 
 	 /* Make sure all CPUs receive a corresponding Tx queue. */
-	while (egress_cnt < DPAA_ETH_TXQ_NUM) {
+	if (egress_cnt < DPAA_ETH_TXQ_NUM) {
 		list_for_each_entry(fq, &priv->dpaa_fq_list, list) {
 			if (fq->fq_type != FQ_TYPE_TX)
 				continue;