[PATCH 1/3] ethernet: Add new driver for Marvell Armada 375 network unit

Joe Perches joe at perches.com
Sat Jul 5 14:14:21 PDT 2014


On Sat, 2014-07-05 at 23:03 +0200, Francois Romieu wrote:
> Partial review below.

trivia:

> > diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
[]
> > +static int mvpp2_prs_tcam_first_free(struct mvpp2 *pp2, int start, int end)
> > +{
> > +	int tid;
> > +	bool found = false;
> > +
> > +	if (start < end)
> > +		for (tid = start; tid <= end; tid++) {
> > +			if (!pp2->prs_shadow[tid].valid) {
> > +				found = true;
> > +				break;
> > +			}
> > +		}
> > +	else
> > +		for (tid = start; tid >= end; tid--) {
> > +			if (!pp2->prs_shadow[tid].valid) {
> > +				found = true;
> > +				break;
> > +			}
> > +		}
> 
> Missing parenthsesis in "if ... else ..." block.

Perhaps it's better to use swap if start > end

	if (start > end)
		swap(start, end);

so there's just one loop





More information about the linux-arm-kernel mailing list