All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: tao <wangtaowt166@163.com>
Cc: richardcochran@gmail.com, netdev@vger.kernel.org
Subject: Re: [RFC] ptp: Delete invalided timestamp event queue code
Date: Wed, 9 Oct 2024 08:06:37 +0100	[thread overview]
Message-ID: <20241009070637.GF99782@kernel.org> (raw)
In-Reply-To: <20241007152502.387840-1-wangtaowt166@163.com>

On Mon, Oct 07, 2024 at 11:25:02PM +0800, tao wrote:
> used timestamp event queue In ptp_open func,  queue of ptp_clock_register
>  already invalid so delete it
> 
> Signed-off-by: tao <wangtaowt166@163.com>
> ---
>  drivers/ptp/ptp_clock.c | 19 -------------------
>  1 file changed, 19 deletions(-)
> 
> diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
> index c56cd0f63909..9be8136cb64c 100644
> --- a/drivers/ptp/ptp_clock.c
> +++ b/drivers/ptp/ptp_clock.c
> @@ -235,7 +235,6 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
>  				     struct device *parent)
>  {
>  	struct ptp_clock *ptp;
> -	struct timestamp_event_queue *queue = NULL;
>  	int err, index, major = MAJOR(ptp_devt);
>  	char debugfsname[16];
>  	size_t size;
> @@ -260,20 +259,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
>  	ptp->devid = MKDEV(major, index);
>  	ptp->index = index;
>  	INIT_LIST_HEAD(&ptp->tsevqs);
> -	queue = kzalloc(sizeof(*queue), GFP_KERNEL);
> -	if (!queue) {
> -		err = -ENOMEM;
> -		goto no_memory_queue;
> -	}
> -	list_add_tail(&queue->qlist, &ptp->tsevqs);

Here the queue is connected to ptp->tseqvs,
as was the case when it was added in

d26ab5a35ad9 ("ptp: Replace timestamp event queue with linked list")

Are you saying that it is no longer used as per that commit?

>  	spin_lock_init(&ptp->tsevqs_lock);
> -	queue->mask = bitmap_alloc(PTP_MAX_CHANNELS, GFP_KERNEL);
> -	if (!queue->mask) {
> -		err = -ENOMEM;
> -		goto no_memory_bitmap;
> -	}
> -	bitmap_set(queue->mask, 0, PTP_MAX_CHANNELS);
> -	spin_lock_init(&queue->lock);
>  	mutex_init(&ptp->pincfg_mux);
>  	mutex_init(&ptp->n_vclocks_mux);
>  	init_waitqueue_head(&ptp->tsev_wq);
> @@ -380,11 +366,6 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
>  kworker_err:
>  	mutex_destroy(&ptp->pincfg_mux);
>  	mutex_destroy(&ptp->n_vclocks_mux);
> -	bitmap_free(queue->mask);
> -no_memory_bitmap:
> -	list_del(&queue->qlist);
> -	kfree(queue);
> -no_memory_queue:
>  	xa_erase(&ptp_clocks_map, index);
>  no_slot:
>  	kfree(ptp);
> -- 
> 2.25.1
> 
> 

      reply	other threads:[~2024-10-09  7:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-07 15:25 [RFC] ptp: Delete invalided timestamp event queue code tao
2024-10-09  7:06 ` Simon Horman [this message]

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=20241009070637.GF99782@kernel.org \
    --to=horms@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=wangtaowt166@163.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.