Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2230153ioo; Sat, 28 May 2022 07:47:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKTTaH95nxfxemomWWqLBfFqRd6x/Q2Kmf6SGDzlTeYm0P9T4Myz+Wo7OMZ/Szt9DiLl0g X-Received: by 2002:a05:6402:22e9:b0:42b:ce34:e707 with SMTP id dn9-20020a05640222e900b0042bce34e707mr17584602edb.327.1653749248900; Sat, 28 May 2022 07:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653749248; cv=none; d=google.com; s=arc-20160816; b=tmjlHQ+mfTrwjl+sUl//uORa6cTHZe9EBRoMlcowXV9XlzsMnVV9Iw0J/Amb743prK 0Yl1RBW3GiG3tOdmJNaR72TeVJAUIudaK8bwTgDtyI3naHod4YV1cFmZlyB18UzTvo2z OmTbOqU27lBMU4BBKuYvzA+FyWIaUn7rOIu2s/3rFt7lUHVci8irricidOH3bE4uuBro 1trrL0gpimsPkYcFDF1QtxqJsZPr9jKzVCm1mSfqXoqlTYzVqHrT2SMic3aR8q0NToNV b4PzZCKKhWCgAX4tXj3y3AYPyeT9jP0HXnkri4NZprPzEdBKNIm8SENYph1N1Hw3eHqw JOfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=q7xnILS3T+/n9YCoGkwwJPDp7QQfx2NI05wUO8FsQPo=; b=VTMVm8AVOTzePb1Rg5PdxfQmdxKNxuM8zq6k1x7eACFZU58bpgTnP0MPI2SMU77qtQ CizgngB+017KE+uJx1ga4WZl69XBxbKAVJE+Re0SwNQdyxHsR5aiYTaISCDacdeXh2as I/nBUe1BTLA9eoJLbBcrMi1Z69LI3i8lq4AOQyeRvbUxlehWlSGzdguk+7g+8M2WWcpk ki3dZlMnDdMrpXXnp8RJMnP3gR6TEaPB5CUNvlceBenXBHol9Cfg1DuR5ZURsy+6LjOu QHvc0+nfpaeSo50OLTAakyxrhJrbOq6+4AhqrMhOLSt3vyNebd0OMF/TLJ022R9yNxUc woGA== 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne23-20020a1709077b9700b006fe178ca718si4920878ejc.662.2022.05.28.07.47.02; Sat, 28 May 2022 07:47:28 -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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244920AbiE0GVC (ORCPT + 99 others); Fri, 27 May 2022 02:21:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233671AbiE0GU7 (ORCPT ); Fri, 27 May 2022 02:20:59 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C07EF674C2; Thu, 26 May 2022 23:20:58 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4L8ZQM3dNPzbbt7; Fri, 27 May 2022 14:19:23 +0800 (CST) Received: from dggpemm500018.china.huawei.com (7.185.36.111) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 27 May 2022 14:20:56 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500018.china.huawei.com (7.185.36.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 27 May 2022 14:20:56 +0800 From: keliu To: , , , , , , CC: keliu Subject: [PATCH] net: nfc: Directly use ida_alloc()/free() Date: Fri, 27 May 2022 06:42:25 +0000 Message-ID: <20220527064225.2358248-1-liuke94@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500018.china.huawei.com (7.185.36.111) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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 Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove() . Signed-off-by: keliu --- net/nfc/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/nfc/core.c b/net/nfc/core.c index 5b286e1e0a6f..9a1d61ac40b8 100644 --- a/net/nfc/core.c +++ b/net/nfc/core.c @@ -975,7 +975,7 @@ static void nfc_release(struct device *d) kfree(se); } - ida_simple_remove(&nfc_index_ida, dev->idx); + ida_free(&nfc_index_ida, dev->idx); kfree(dev); } @@ -1066,7 +1066,7 @@ struct nfc_dev *nfc_allocate_device(const struct nfc_ops *ops, if (!dev) return NULL; - rc = ida_simple_get(&nfc_index_ida, 0, 0, GFP_KERNEL); + rc = ida_alloc(&nfc_index_ida, GFP_KERNEL); if (rc < 0) goto err_free_dev; dev->idx = rc; -- 2.25.1