lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 18 Feb 2012 01:03:05 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Matt Carlson <mcarlson@...adcom.com>
CC:	Dan Carpenter <dan.carpenter@...cle.com>, <netdev@...r.kernel.org>
Subject: Re: tg3: Use *_UNKNOWN ethtool definitions

On Fri, 2012-02-17 at 16:54 -0800, Matt Carlson wrote:
> On Fri, Feb 17, 2012 at 09:48:30AM +0300, Dan Carpenter wrote:
> > Hello Matt Carlson,
> > 
> > The patch e740522e6d3a: "tg3: Use *_UNKNOWN ethtool definitions" from 
> > Feb 13, 2012, leads to the following Smatch warning:
> > drivers/net/ethernet/broadcom/tg3.c:1822 tg3_adjust_link()
> > 	 error: tp->link_config.active_speed is never equal to -1 (wrong type 0 - 65535).
> > 
> > -       if ((phydev->link && tp->link_config.active_speed == SPEED_INVALID) ||
> > -           (!phydev->link && tp->link_config.active_speed != SPEED_INVALID) ||
> > +       if ((phydev->link && tp->link_config.active_speed == SPEED_UNKNOWN) ||
> > +           (!phydev->link && tp->link_config.active_speed != SPEED_UNKNOWN) ||
> > 
> > Since tp->link_config.active_speed is an unsigned short, it never is
> > equal to SPEED_UNKNOWN (-1).
> > 
> > I introduced the SPEED_UNKNOWN so I feel bad that it's causing trouble
> > now.  :/
> > 
> > Also this warning:
> > drivers/net/ethernet/broadcom/tg3.c:3909 tg3_phy_copper_begin(14)
> > error: tp->link_config.speed is never equal to -1 (wrong type 0 - 65535).
> 
> Do you have any problems with changing SPEED_UNKNOWN from -1 to 0xffff?

I have a big problem with that - speed values are 32-bit in the ethtool
API.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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

Powered by blists - more mailing lists