[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1421129715.4099.18.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Mon, 12 Jan 2015 22:15:15 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Sanjeev Sharma <sanjeev_sharma@...tor.com>
Cc: davem@...emloft.net, claudiu.manoil@...escale.com,
peter.senna@...il.com, shemminger@...ux-foundation.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] gianfar: correct the bad expression while writing
bit-pattern
On Mon, 2015-01-12 at 22:01 -0800, Eric Dumazet wrote:
> On Tue, 2015-01-13 at 10:58 +0530, Sanjeev Sharma wrote:
> > This patch correct the bad expression while writing the
> > bit-pattern from software's buffer to hardware registers.
> >
> > Signed-off-by: Sanjeev Sharma <Sanjeev_Sharma@...tor.com>
> > ---
> > Changes in v2:
> > - incorporated review comment as per Sergei.
> >
> > drivers/net/ethernet/freescale/gianfar_ethtool.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
> > index 3e1a9c1..347d5ee 100644
> > --- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
> > +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
> > @@ -1586,7 +1586,7 @@ static int gfar_write_filer_table(struct gfar_private *priv,
> > return -EBUSY;
> >
> > /* Fill regular entries */
> > - for (; i < MAX_FILER_IDX - 1 && (tab->fe[i].ctrl | tab->fe[i].ctrl);
> > + for (; i < MAX_FILER_IDX - 1 && i < tab->fe[i].ctrl);
> > i++)
> > gfar_write_filer(priv, i, tab->fe[i].ctrl, tab->fe[i].prop);
> > /* Fill the rest with fall-troughs */
>
> This makes no sense. Have you tried to compile this ?
I have no idea of what this code is trying to do, but most likely
author intent was to break loop when both ctrl and prop are 0 :
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
index 3e1a9c1a67a9..fda12fb32ec7 100644
--- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
@@ -1586,7 +1586,7 @@ static int gfar_write_filer_table(struct gfar_private *priv,
return -EBUSY;
/* Fill regular entries */
- for (; i < MAX_FILER_IDX - 1 && (tab->fe[i].ctrl | tab->fe[i].ctrl);
+ for (; i < MAX_FILER_IDX - 1 && (tab->fe[i].ctrl | tab->fe[i].prop);
i++)
gfar_write_filer(priv, i, tab->fe[i].ctrl, tab->fe[i].prop);
/* Fill the rest with fall-troughs */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists