RE: [PATCH V5 2/8] net: sxgbe: add basic framework for Samsung 10Gb ethernet driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Joe Perches <joe@xxxxxxxxxxx> wrote : 
> On Tue, 2014-03-18 at 11:19 -0700, Byungho An wrote:
> > From: Siva Reddy <siva.kallam@xxxxxxxxxxx>
> >
> > This patch adds support for Samsung 10Gb ethernet driver(sxgbe).
> 
> More trivia, nothing that should stop this from being applied and updated
> later...
> 
> > diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_mdio.c
> > b/drivers/net/ethernet/samsung/sxgbe/sxgbe_mdio.c
> []
> > +static int sxgbe_mdio_busy_wait(void __iomem *ioaddr, unsigned int
> > +mii_data) {
> > +	unsigned long cur_time;
> > +	unsigned long fin_time = jiffies + 3 * HZ; /* 30 ms */
> 
> This is actually 3 seconds.
> If this should be 30ms, then use msecs_to_jiffies(30)
This is a typo, comment will be changed to "3 sec".

> 
> > +
> > +	do {
> > +		cur_time = jiffies;
> > +		if (readl(ioaddr + mii_data) & SXGBE_MII_BUSY)
> > +			cpu_relax();
> > +		else
> > +			return 0;
> > +	} while (!time_after_eq(cur_time, fin_time));
> > +
> > +	return -EBUSY;
> > +}
> 
> This may be clearer as
> 
> 	unsigned long fin_time = jiffies + msecs_to_jiffies(30);
> 
> 	while (!time_after(jiffies, fin_time))
> 		if (!(readl(ioaddr + mii_data) & SXGBE_MII_BUSY))
> 			return 0;
> 		cpu_relax();
> 	}
> 
> 	return -EBUSY;
OK.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux