Subject: Re: [PATCH] [v3] net: phy: phy drivers should not set SUPPORTED_[Asym_]Pause

From: Timur Tabi <[email-masked]>
Date: Tue, 6 Dec 2016 19:50:03 -0600

Florian Fainelli wrote:
>> +	if (phydrv->features & (SUPPORTED_Pause | SUPPORTED_Asym_Pause)) {
>> >+		phydev->supported &= ~(SUPPORTED_Pause | SUPPORTED_Asym_Pause);
>> >+		phydev->supported |= phydrv->features &
>> >+				     (SUPPORTED_Pause | SUPPORTED_Asym_Pause);
> Is not the & (SUPPORTED_Pause | SUPPORTED_Asym_Pause) redundant here anyway?

I'm just trying to be safe.  Can I be certain that those bits are 
already zero?

>
>> >+	} else {
>> >+		phydev->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
> that part looks good.
>
>> >+	}
>> >+
>> >+	phydev->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
> but this one basically "undoes" what the if () clause did where we
> checked if either, or one of the two bits was already set?

Ugh, sorry.  I thought I deleted that before sending the patch out. 
I'll send out a v4 tomorrow.

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, hosted by The Linux Foundation.