Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2945861iog; Mon, 27 Jun 2022 06:16:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1teBSsrpchrUbx+HdKHZNaOgXYeB2q0DbI6P4hKBefdjNlF6P/ThzQ1HlEkSvFgt8rxBoau X-Received: by 2002:a63:b00e:0:b0:40c:c685:d45 with SMTP id h14-20020a63b00e000000b0040cc6850d45mr12826746pgf.494.1656335789970; Mon, 27 Jun 2022 06:16:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656335789; cv=none; d=google.com; s=arc-20160816; b=X/0E/71WNppaMv6rNoyz7YRyVVW9+Lf1EsIq/+oufiTbJ/fBFW8eImd5iu3sNIMZDM TnhvesqHXQ8qUFZ/+qqI7PzWSu74KuQv4Oh5tOji483APHYKO2HS5XQMuQyQi4MltFTt rIVb7gbK2TOwYHOnW1q7NhrTc6LXCppL4ffKiMpWmwOed6wLETCLK1cz1El8D3mZiFVi qXGIRepmQHibtEIxZk9TywqbfQgnPK2MSG4tq2OYF+yroC/xEnBY+k53POW00RPSHbxL ULB7n/+Yr0iJE6/CcIxVVPw5UX49A5Mn6dO1nA256fMzb0nWjJnFJAoC875KwTlN/jH9 RQ3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=GgExRoy41rShLe6OZBd6TpG/09+o4pDxkij+/12PSqE=; b=Hf8kg69gkysEaGyiaH0B8qmHojuloz3TY0J5C3mnSyDDvNr8Qv8S3E3FIAtAsvYAM9 HjVBoq90FeE91N5KofC93x9qVdjtnAXPKE+pr+FwcdvZjUSaSyW9HCfGdrS68wEIdckV rAxbMF7YIMrOIgEgXSjgJgyGEN6cA0RIQfjCPrswbQXyjEMHR30nrH6Cg/5OAzdA+hhc OBYCq+OQHuzSNOtbXTARxgvUEbYzX7FNyGDbmvPXFLyCD5UpGs1inxhk6EthBtOfkKoC rmZwXxIJSg4Ra3F2DCWXWlDdcsXM3UJxUUR8iri4jB2A3pNR/QAbq/B4d7Ge5L9N+w5e Crwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p129-20020a634287000000b0040d6a030f8dsi14565227pga.764.2022.06.27.06.16.11; Mon, 27 Jun 2022 06:16:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240154AbiF0MCt (ORCPT + 99 others); Mon, 27 Jun 2022 08:02:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239687AbiF0L57 (ORCPT ); Mon, 27 Jun 2022 07:57:59 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 082C510576 for ; Mon, 27 Jun 2022 04:54:31 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D170B2B; Mon, 27 Jun 2022 04:54:30 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EBE503F792; Mon, 27 Jun 2022 04:54:29 -0700 (PDT) Date: Mon, 27 Jun 2022 12:54:23 +0100 From: Cristian Marussi To: Bo Liu Cc: sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] firmware: arm_scmi: Remove usage of the deprecated ida_simple_xxx API Message-ID: References: <20220616055052.4559-1-liubo03@inspur.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220616055052.4559-1-liubo03@inspur.com> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- 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 >