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  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]
Date:   Mon, 6 Nov 2017 10:46:58 +0100
From:   Egil Hjelmeland <privat@...l-hjelmeland.no>
To:     Joe Perches <joe@...ches.com>, andrew@...n.ch,
        vivien.didelot@...oirfairelinux.com, f.fainelli@...il.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 4/5] net: dsa: lan9303: Remove unnecessary
 parentheses

On 03. nov. 2017 15:35, Egil Hjelmeland wrote:
> On 03. nov. 2017 15:11, Joe Perches wrote:
>> On Fri, 2017-11-03 at 11:55 +0100, Egil Hjelmeland wrote:
>>> Remove scripts/checkpatch.pl CHECKs by remove unnecessary parentheses
>> []
>>> diff --git a/drivers/net/dsa/lan9303-core.c 
>>> b/drivers/net/dsa/lan9303-core.c
>> []
>>> @@ -483,7 +483,7 @@ static int lan9303_detect_phy_setup(struct 
>>> lan9303 *chip)
>>>           return reg;
>>>       }
>>> -    if ((reg != 0) && (reg != 0xffff))
>>> +    if (reg != 0 && reg != 0xffff)
>>>           chip->phy_addr_sel_strap = 1;
>>>       else
>>>           chip->phy_addr_sel_strap = 0;
>>
>> phy_addr_sel_strap is currently bool.
>>
>> If this is to be changed, it should be set
>> true or false.
>>
>> My preference would be:
>>
>>     chip->phy_addr_sel_strap = (reg != 0 && reg != 0xffff);
>>
>> But perhaps its bool type should be converted
>> to int as this phy_addr_sel_strap is used as
>> int several times.
>>
> 
> Hi Joe
> 
> I had not noticed that phy_addr_sel_strap is bool. I agree that is
> misleading. Your suggestion is perhaps a bit "magic", but on the other
> hand the magic is explained well in the comment above.
> 
> If there are no disagreements, I can do a v2 with that.
> 
> And thanks for teaching me about "git grep"!
> 
> Cheers
> Egil
> 
Hi
I changed my mind slightly. I will just remove patch 4 in v2. In stead
deal with phy_addr_sel_strap in a separate post.

Because I think I want to rename phy_addr_sel_strap as well, plus some
other simplification. So starting to creep out of the "linting" scope.

Egil

Powered by blists - more mailing lists