lkml.org 
[lkml]   [2023]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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);

\
 
 \ /
  Last update: 2023-03-27 01:13    [W:0.036 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site