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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230322222403.39191060@kernel.org>
Date:   Wed, 22 Mar 2023 22:24:03 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Harini Katakam <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>, <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.

> +	if (IS_ENABLED(CONFIG_MACB_USE_HWSTAMP) && gem_has_ptp(bp))
> +		ctrl |= MACB_BIT(PTPUNI);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ