LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Clay McClure <clay@daemons.net>
Cc: "David S. Miller" <davem@davemloft.net>,
	Sekhar Nori <nsekhar@ti.com>,
	Richard Cochran <richardcochran@gmail.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: cpts: Condition WARN_ON on PTP_1588_CLOCK
Date: Thu, 16 Apr 2020 14:11:45 +0300
Message-ID: <6fef3a00-6c18-b775-d1b4-dfd692261bd3@ti.com> (raw)
In-Reply-To: <20200416085627.1882-1-clay@daemons.net>



On 16/04/2020 11:56, Clay McClure wrote:
> CPTS_MOD merely implies PTP_1588_CLOCK; it is possible to build cpts
> without PTP clock support. In that case, ptp_clock_register() returns
> NULL and we should not WARN_ON(cpts->clock) when downing the interface.
> The ptp_*() functions are stubbed without PTP_1588_CLOCK, so it's safe
> to pass them a null pointer.

Could you explain the purpose of the exercise (Enabling CPTS with PTP_1588_CLOCK disabled), pls?

> 
> Signed-off-by: Clay McClure <clay@daemons.net>
> ---
>   drivers/net/ethernet/ti/cpts.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
> index fd214f8730a9..daf4505f4a70 100644
> --- a/drivers/net/ethernet/ti/cpts.c
> +++ b/drivers/net/ethernet/ti/cpts.c
> @@ -646,7 +646,7 @@ EXPORT_SYMBOL_GPL(cpts_register);
>   
>   void cpts_unregister(struct cpts *cpts)
>   {
> -	if (WARN_ON(!cpts->clock))
> +	if (IS_REACHABLE(PTP_1588_CLOCK) && WARN_ON(!cpts->clock))
>   		return;
>   
>   	ptp_clock_unregister(cpts->clock);
> 

-- 
Best regards,
grygorii

  reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16  8:56 Clay McClure
2020-04-16 11:11 ` Grygorii Strashko [this message]
2020-04-20  9:36   ` Clay McClure
2020-04-20 14:38     ` Arnd Bergmann
2020-04-20 17:00       ` Richard Cochran
2020-04-20 18:57         ` Arnd Bergmann
2020-04-20 21:18           ` Richard Cochran
2020-04-20 21:21             ` Arnd Bergmann
2020-04-20 21:34               ` Richard Cochran
2020-04-20 21:42                 ` Arnd Bergmann
2020-04-22 11:16                   ` Grygorii Strashko
2020-04-26  2:41                     ` Clay McClure

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=6fef3a00-6c18-b775-d1b4-dfd692261bd3@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=clay@daemons.net \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nsekhar@ti.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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git
	git clone --mirror https://lore.kernel.org/lkml/9 lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git