mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Köry Maincent" <kory.maincent@bootlin.com>
To: Simon Horman <horms@kernel.org>
Cc: Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	thomas.petazzoni@bootlin.com,
	Richard Cochran <richardcochran@gmail.com>
Subject: Re: [PATCH net-next] ptp: Move from simple ida to xarray
Date: Mon, 11 Mar 2024 10:08:56 +0100	[thread overview]
Message-ID: <20240311100856.4187d247@kmaincent-XPS-13-7390> (raw)
In-Reply-To: <20240308210745.GE603911@kernel.org>

On Fri, 8 Mar 2024 21:07:45 +0000
Simon Horman <horms@kernel.org> wrote:

> On Thu, Mar 07, 2024 at 11:03:26AM +0100, Kory Maincent wrote:
> > Move from simple ida to xarray for storing and loading the ptp_clock
> > pointer. This prepares support for future hardware timestamp selection by
> > being able to link the ptp clock index to its pointer.
> > 
> > Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>  
> 
> ...
> 
> > @@ -246,11 +246,10 @@ struct ptp_clock *ptp_clock_register(struct
> > ptp_clock_info *info, if (ptp == NULL)
> >  		goto no_memory;
> >  
> > -	index = ida_alloc_max(&ptp_clocks_map, MINORMASK, GFP_KERNEL);
> > -	if (index < 0) {
> > -		err = index;
> > +	err = xa_alloc(&ptp_clocks_map, &index, ptp, xa_limit_31b,
> > +		       GFP_KERNEL);
> > +	if (err)
> >  		goto no_slot;
> > -	}
> >  
> >  	ptp->clock.ops = ptp_clock_ops;
> >  	ptp->info = info;  
> 
> Hi Kory,
> 
> Prior to this change err was -ENOMEM at this point. Now it is 0.

You are totally right. Thanks for reporting the issue!

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

      reply	other threads:[~2024-03-11  9:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 10:03 Kory Maincent
2024-03-08 21:07 ` Simon Horman
2024-03-11  9:08   ` Köry Maincent [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=20240311100856.4187d247@kmaincent-XPS-13-7390 \
    --to=kory.maincent@bootlin.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=thomas.petazzoni@bootlin.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

all inboxes | Powered by JetHome®