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  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181223100630.GB31681@lunn.ch>
Date:   Sun, 23 Dec 2018 11:06:30 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Heiner Kallweit <hkallweit1@...il.com>
Cc:     Marek Vasut <marex@...x.de>, netdev@...r.kernel.org,
        Florian Fainelli <f.fainelli@...il.com>
Subject: Re: [PATCH V3] net: phy: tja11xx: Add TJA11xx PHY driver

> > +	switch (attr) {
> > +	case hwmon_in_lcrit_alarm:
> > +		ret = phy_read(phydev, MII_INTSRC);
> > +		if (ret < 0)
> > +			return ret;
> > +
> > +		*value = !!(ret & MII_INTSRC_TEMP_ERR);
> > +		return 0;
> > +	case hwmon_temp_crit_alarm:
> > +		ret = phy_read(phydev, MII_INTSRC);
> > +		if (ret < 0)
> > +			return ret;
> > +
> > +		*value = !!(ret & MII_INTSRC_TEMP_ERR);
> > +		return 0;
> > +	default:
> > +		return -EOPNOTSUPP;
> > +	}
> > +}
> This looks like a copy & paste error, in both cases you're doing the same.

You also should not do it like this. hwmon_temp_crit_alarm is in a
different set of enum's as hwmon_in_lcrit_alarm. hwmon_in_lcrit_alarm
= 14.  hwmon_temp_max_alarm also is 14. You should have two different
switch statements to take account of this.

       Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ