On Mon, 29 Oct 2007 06:05:14 -0400
Jeff Garzik <[EMAIL PROTECTED]> wrote:

> Auke Kok wrote:
> > Trivial replacement - use INT_MAX instead here.
> > 
> > Signed-off-by: Auke Kok <[EMAIL PROTECTED]>
> > Cc: [EMAIL PROTECTED]
> > ---
> > 
> >  drivers/net/sk98lin/skethtool.c |    4 ++--
> >  drivers/net/skge.c              |    8 ++++----
> >  drivers/net/sky2.c              |    8 ++++----
> >  3 files changed, 10 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/net/sk98lin/skethtool.c 
> > b/drivers/net/sk98lin/skethtool.c
> > index 5a6da89..4549b97 100644
> > --- a/drivers/net/sk98lin/skethtool.c
> > +++ b/drivers/net/sk98lin/skethtool.c
> > @@ -430,8 +430,8 @@ static int locateDevice(struct net_device *dev, u32 
> > data)
> >     DEV_NET *pNet = netdev_priv(dev);
> >     SK_AC *pAC = pNet->pAC;
> >  
> > -   if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
> > -           data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
> > +   if (!data)
> > +           data = INT_MAX;
> >  
> >     /* start blinking */
> >     pAC->LedsOn = 0;
> > diff --git a/drivers/net/skge.c b/drivers/net/skge.c
> > index b9961dc..696a79e 100644
> > --- a/drivers/net/skge.c
> > +++ b/drivers/net/skge.c
> > @@ -783,10 +783,10 @@ static int skge_phys_id(struct net_device *dev, u32 
> > data)
> >     unsigned long ms;
> >     enum led_mode mode = LED_MODE_TST;
> >  
> > -   if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
> > -           ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT / HZ) * 1000;
> > -   else
> > -           ms = data * 1000;
> > +   if (!data)
> > +           data = INT_MAX;
> > +
> > +   ms = data * HZ;
> >  
> >     while (ms > 0) {
> >             skge_led(skge, mode);
> > diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
> > index c27c7d6..1381d04 100644
> > --- a/drivers/net/sky2.c
> > +++ b/drivers/net/sky2.c
> > @@ -3336,10 +3336,10 @@ static int sky2_phys_id(struct net_device *dev, u32 
> > data)
> >     int interrupted;
> >     int onoff = 1;
> >  
> > -   if (!data || data > (u32) (MAX_SCHEDULE_TIMEOUT / HZ))
> > -           ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT);
> > -   else
> > -           ms = data * 1000;
> > +   if (!data)
> > +           data = INT_MAX:
> > +
> > +   ms = data * HZ;
> 
> ditto comments in previous email...

Since these all use ethtool, shouldn't the checks be put into ethtool_phys_id
rather than having the driver check?


-- 
Stephen Hemminger <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to