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] [day] [month] [year] [list]
Date:   Fri, 19 May 2023 18:53:38 +0800
From:   Min-Hua Chen <minhuadotchen@...il.com>
To:     simon.horman@...igine.com
Cc:     alexandre.torgue@...s.st.com, davem@...emloft.net,
        edumazet@...gle.com, joabreu@...opsys.com, kuba@...nel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-stm32@...md-mailman.stormreply.com,
        mcoquelin.stm32@...il.com, minhuadotchen@...il.com,
        netdev@...r.kernel.org, pabeni@...hat.com, peppe.cavallaro@...com
Subject: Re: [PATCH] net: stmmac: use le32_to_cpu for p->des0 and p->des1

Hi Simon,

>>  
>>  	if (likely(desc_valid && ts_valid)) {
>> -		if ((p->des0 == 0xffffffff) && (p->des1 == 0xffffffff))
>> +		if ((le32_to_cpu(p->des0) == 0xffffffff) &&
>> +		    (le32_to_cpu(p->des1) == 0xffffffff))
>
>Hi Min-Hua Chen,
>
>I'm not sure if it makes a meaningful difference in practice - and
>certainly it won't on LE systems. But I wonder if it's nicer to do the
>conversion on the constant rather than the variable part of the comparison.
>
>		if ((p->des0 == cpu_to_le32(0xffffffff)) &&
>		    (p->des1 == cpu_to_le32(0xffffffff)))

After reading your suggestion, I think:
the 'p->des0 == cpu_to_le32(0xffffffff)' gives the readers a hint that
p->des0 is __le32 type and I think it is easier (for me) to understand
than 'le32_to_cpu(p->des0) == 0xffffffff'

I will submit v2 for this, thanks for your comment.

thanks,
Min-Hua

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ