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]
Message-ID: <BYAPR12MB4773239308DD06E4B80E14BC9E879@BYAPR12MB4773.namprd12.prod.outlook.com>
Date:   Thu, 23 Mar 2023 07:01:37 +0000
From:   "Katakam, Harini" <harini.katakam@....com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     "nicolas.ferre@...rochip.com" <nicolas.ferre@...rochip.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "richardcochran@...il.com" <richardcochran@...il.com>,
        "claudiu.beznea@...rochip.com" <claudiu.beznea@...rochip.com>,
        "andrei.pistirica@...rochip.com" <andrei.pistirica@...rochip.com>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Simek, Michal" <michal.simek@....com>,
        "harinikatakamlinux@...il.com" <harinikatakamlinux@...il.com>
Subject: RE: [PATCH net-next v2 1/2] net: macb: Enable PTP unicast

Hi Jakub,

> -----Original Message-----
> From: Jakub Kicinski <kuba@...nel.org>
> Sent: Thursday, March 23, 2023 10:54 AM
> To: Katakam, Harini <harini.katakam@....com>
> Cc: nicolas.ferre@...rochip.com; davem@...emloft.net;
> richardcochran@...il.com; claudiu.beznea@...rochip.com;
> andrei.pistirica@...rochip.com; edumazet@...gle.com;
> pabeni@...hat.com; netdev@...r.kernel.org; linux-kernel@...r.kernel.org;
> Simek, Michal <michal.simek@....com>; harinikatakamlinux@...il.com
> Subject: Re: [PATCH net-next v2 1/2] net: macb: Enable PTP unicast
> 
> On Tue, 21 Mar 2023 18:10:04 +0530 Harini Katakam wrote:
> > +#ifdef CONFIG_MACB_USE_HWSTAMP
> > +	if (gem_has_ptp(bp)) {
> > +		gem_writel(bp, RXPTPUNI, bottom);
> > +		gem_writel(bp, TXPTPUNI, bottom);
> > +	}
> > +#endif
> 
> You can use the same IS_ENABLED() trick here as you used in the if ()
> below, to avoid the direct preprocessor use. In fact why not just
> add the IS_ENABLED(CONFIG_MACB_USE_HWSTAMP) to the condition inside
> gem_has_ptp() ? It looks like all callers want that extra check.

Thanks for the suggestion.
I believe gem_has_ptp was originally defined for checking device
capability (Atmel/SiFive/AMD) and CONFIG_MACB_USE_HWSTAMP for the
kernel selection but I agree that there is currently no usecase for a 
scenario where gem_has_ptp is TRUE and MACB_USE_HWSTAMP is false. If
hear are no objections, I'll include this check inside gem_has_ptp and send v3.

Regards,
Harini

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ