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: <81ca7397-3f00-431d-aea4-c30c363a90e6@tuxon.dev>
Date: Tue, 13 Feb 2024 20:55:24 +0200
From: claudiu beznea <claudiu.beznea@...on.dev>
To: Biju Das <biju.das.jz@...renesas.com>,
 "s.shtylyov@....ru" <s.shtylyov@....ru>,
 "davem@...emloft.net" <davem@...emloft.net>,
 "edumazet@...gle.com" <edumazet@...gle.com>,
 "kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
 "linux-renesas-soc@...r.kernel.org" <linux-renesas-soc@...r.kernel.org>,
 "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
 Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
Subject: Re: [PATCH net-next v3 5/6] net: ravb: Do not apply features to
 hardware if the interface is down



On 13.02.2024 13:07, claudiu beznea wrote:
>>> @@ -2566,15 +2566,23 @@ static int ravb_set_features(struct net_device
>>> *ndev,  {
>>>  	struct ravb_private *priv = netdev_priv(ndev);
>>>  	const struct ravb_hw_info *info = priv->info;
>>> -	int ret;
>>> +	struct device *dev = &priv->pdev->dev;
>>> +	int ret = 0;
>>> +
>>> +	pm_runtime_get_noresume(dev);
>>> +
>>> +	if (!pm_runtime_active(dev))
>>> +		goto out_set_features;
>> This can be simplified, which avoids 1 goto statement and
>> Unnecessary ret initialization. I am leaving to you and Sergey.
>>
>> 	if (!pm_runtime_active(dev))
>> 		ret = 0;
>> 	else
>> 		ret = info->set_feature(ndev, features);
>>
>> 	pm_runtime_put_noidle(dev);
>> 	if (ret)
>> 		goto err;
>>
>> 	ndev->features = features;
>>
>> err:
>> 	return ret;
>>
> I find it a bit difficult to follow this way.

Looking again at it, your version seems better.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ