lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 27 Jun 2022 12:54:23 +0100
From:   Cristian Marussi <cristian.marussi@....com>
To:     Bo Liu <liubo03@...pur.com>
Cc:     sudeep.holla@....com, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] firmware: arm_scmi: Remove usage of the deprecated
 ida_simple_xxx API

On Thu, Jun 16, 2022 at 01:50:52AM -0400, Bo Liu wrote:
> Use ida_alloc_xxx()/ida_free() instead of
> ida_simple_get()/ida_simple_remove().
> The latter is deprecated and more verbose.
> 
> Signed-off-by: Bo Liu <liubo03@...pur.com>
> ---

Hi Bo,

I've missed this patch of yours and I recently posted something similar
using a bare ida_alloc() (so starting with id 0 instead).

Anyway AFAIU, Sudeep will pick up your patch with a small change to use
ida_alloc.

Thanks for this,
Cristian


>  drivers/firmware/arm_scmi/bus.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
> index f6fe723ab869..d4e23101448a 100644
> --- a/drivers/firmware/arm_scmi/bus.c
> +++ b/drivers/firmware/arm_scmi/bus.c
> @@ -181,7 +181,7 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol,
>  		return NULL;
>  	}
>  
> -	id = ida_simple_get(&scmi_bus_id, 1, 0, GFP_KERNEL);
> +	id = ida_alloc_min(&scmi_bus_id, 1, GFP_KERNEL);
>  	if (id < 0) {
>  		kfree_const(scmi_dev->name);
>  		kfree(scmi_dev);
> @@ -204,7 +204,7 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol,
>  put_dev:
>  	kfree_const(scmi_dev->name);
>  	put_device(&scmi_dev->dev);
> -	ida_simple_remove(&scmi_bus_id, id);
> +	ida_free(&scmi_bus_id, id);
>  	return NULL;
>  }
>  
> @@ -212,7 +212,7 @@ void scmi_device_destroy(struct scmi_device *scmi_dev)
>  {
>  	kfree_const(scmi_dev->name);
>  	scmi_handle_put(scmi_dev->handle);
> -	ida_simple_remove(&scmi_bus_id, scmi_dev->id);
> +	ida_free(&scmi_bus_id, scmi_dev->id);
>  	device_unregister(&scmi_dev->dev);
>  }
>  
> -- 
> 2.27.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ