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: <53C3B695.6000001@gmail.com>
Date:	Mon, 14 Jul 2014 16:23:09 +0530
From:	Varka Bhadram <varkabhadram@...il.com>
To:	David Laight <David.Laight@...LAB.COM>,
	Jongsung Kim <neidhard.kim@....com>,
	"nicolas.ferre@...el.com" <nicolas.ferre@...el.com>
CC:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"davem@...emloft.net" <davem@...emloft.net>
Subject: Re: [PATCH 1/2] net: cadence: macb: add support for the WOL

On 07/14/2014 04:19 PM, David Laight wrote:
> From: Varka Bhadram
>> On 07/14/2014 02:32 PM, Jongsung Kim wrote:
>>> This patch enables the ethtool utility to control the WOL function
>>> of the PHY connected to the GEM/MACB. (if supported)
> ...
>>> +static int macb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
>>> +{
>>> +	struct macb *bp = netdev_priv(netdev);
>>> +	struct phy_device *phydev = bp->phy_dev;
>>> +	int err = -ENODEV;
>>> +
>>> +	if (phydev)
>>> +		err = phy_ethtool_set_wol(phydev, wol);
>>> +
>>> +	return err;
>>> +}
>>> +
>> I think we can do in this way:
>>
>> if (phydev)
>> 	return phy_ethtool_set_wol(phydev, wol);
>> else
>> 	return -ENODEV;
>>
>>
>> we can save err. What do you say ...?
> I would do:
> 	if (!phydev)
> 		return -ENODEV;
> 	return phy_ethtool_set_wol(phydev, wol);

I will agree with this....  :-)

if (!phydev) {
	netdev_err("bla bla...");
	return -ENODEV;
}
return phy_ethtool_set_wol(phydev, wol);



-- 
Regards,
Varka Bhadram.

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ