public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Harini Katakam <harini.katakam@amd.com>
Cc: <nicolas.ferre@microchip.com>, <davem@davemloft.net>,
	<richardcochran@gmail.com>, <claudiu.beznea@microchip.com>,
	<andrei.pistirica@microchip.com>, <edumazet@google.com>,
	<pabeni@redhat.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <michal.simek@amd.com>,
	<harinikatakamlinux@gmail.com>
Subject: Re: [PATCH net-next v2 1/2] net: macb: Enable PTP unicast
Date: Wed, 22 Mar 2023 22:24:03 -0700	[thread overview]
Message-ID: <20230322222403.39191060@kernel.org> (raw)
In-Reply-To: <20230321124005.7014-2-harini.katakam@amd.com>

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);

  reply	other threads:[~2023-03-23  5:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 12:40 [PATCH net-next v2 0/2] Macb PTP minor updates Harini Katakam
2023-03-21 12:40 ` [PATCH net-next v2 1/2] net: macb: Enable PTP unicast Harini Katakam
2023-03-23  5:24   ` Jakub Kicinski [this message]
2023-03-23  7:01     ` Katakam, Harini
2023-03-21 12:40 ` [PATCH net-next v2 2/2] net: macb: Optimize reading HW timestamp Harini Katakam
  -- strict thread matches above, loose matches on Subject: below --
2023-03-21 12:38 [PATCH net-next v2 0/2] Macb PTP minor updates Harini Katakam
2023-03-21 12:38 ` [PATCH net-next v2 1/2] net: macb: Enable PTP unicast Harini Katakam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230322222403.39191060@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrei.pistirica@microchip.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=harini.katakam@amd.com \
    --cc=harinikatakamlinux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox