[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CO1PR11MB5089864325798E18DBBA9815D6BA2@CO1PR11MB5089.namprd11.prod.outlook.com>
Date: Fri, 9 Aug 2024 19:55:56 +0000
From: "Keller, Jacob E" <jacob.e.keller@...el.com>
To: "Lobakin, Aleksander" <aleksander.lobakin@...el.com>, "Polchlopek,
Mateusz" <mateusz.polchlopek@...el.com>
CC: "intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>, "Drewek, Wojciech"
<wojciech.drewek@...el.com>, Sai Krishna <saikrishnag@...vell.com>, "Simon
Horman" <horms@...nel.org>, "Zaki, Ahmed" <ahmed.zaki@...el.com>
Subject: RE: [Intel-wired-lan] [PATCH iwl-next v8 06/14] iavf: add initial
framework for registering PTP clock
> -----Original Message-----
> From: Lobakin, Aleksander <aleksander.lobakin@...el.com>
> Sent: Thursday, August 8, 2024 5:25 AM
> To: Polchlopek, Mateusz <mateusz.polchlopek@...el.com>
> Cc: intel-wired-lan@...ts.osuosl.org; netdev@...r.kernel.org; Keller, Jacob E
> <jacob.e.keller@...el.com>; Drewek, Wojciech <wojciech.drewek@...el.com>; Sai
> Krishna <saikrishnag@...vell.com>; Simon Horman <horms@...nel.org>; Zaki,
> Ahmed <ahmed.zaki@...el.com>
> Subject: Re: [Intel-wired-lan] [PATCH iwl-next v8 06/14] iavf: add initial framework
> for registering PTP clock
>
> From: Mateusz Polchlopek <mateusz.polchlopek@...el.com>
> Date: Thu, 8 Aug 2024 13:04:29 +0200
>
> >
> >
> > On 7/30/2024 3:40 PM, Alexander Lobakin wrote:
> >> From: Mateusz Polchlopek <mateusz.polchlopek@...el.com>
> >> Date: Tue, 30 Jul 2024 05:15:01 -0400
>
> [...]
>
> >>> +bool iavf_ptp_cap_supported(struct iavf_adapter *adapter, u32 cap)
> >>> +{
> >>> + if (!PTP_ALLOWED(adapter))
> >>> + return false;
> >>> +
> >>> + /* Only return true if every bit in cap is set in hw_caps.caps */
> >>> + return (adapter->ptp.hw_caps.caps & cap) == cap;
> >>
> >> Aren't these parenthesis redundant?
> >>
> >
> > I think they are not. They wrap bit operation and also I checked it
> > with checkpatch script and it doesn't complain about reduntant
> > parenthesis.
>
> If the object code doesn't change when compiling without them, there are
> no compiler complains etc, then they are :D checkpatch doesn't always
> catch things, but I don't remember whether the compiler won't complain
> or change the object code / logic. Could you please check?
>
> Thanks,
> Olek
They may be technically redundant in that the parenthesis don't matter.. but sometimes they can help code legibility by making it more obvious to a human reviewer who isn't immediately going to think like a compiler and realize that & is not && for example...
Powered by blists - more mailing lists