From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAFCCC4167B for ; Sun, 10 Dec 2023 18:42:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232014AbjLJSl6 (ORCPT ); Sun, 10 Dec 2023 13:41:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjLJSl4 (ORCPT ); Sun, 10 Dec 2023 13:41:56 -0500 Received: from smtp.smtpout.orange.fr (smtp-23.smtpout.orange.fr [80.12.242.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40CB7DF for ; Sun, 10 Dec 2023 10:42:01 -0800 (PST) Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id COkVr0Jjza8POCOkVrYw1e; Sun, 10 Dec 2023 19:41:59 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1702233719; bh=I4d7pDDCyjT9L0OHzm3kZ0ExqvKGHQ3K/sxp0Y597HM=; h=From:To:Cc:Subject:Date; b=ZaqfFfTj5/sK1oG0y6x+Yv/Iag8x3sqCmGofmIBzxwSpdXL5Rkmt9+jSBKtxXS/OC RL1LwO2tYWJjCsLvGWHXaGzc3rnOkKg7aQ7DqsE1sqxd+n5J75fxfbULD66wDgyMWu JJHtsqNmUmuzfNBjZBO0bE/x4TDxvvh4bzj8leLCfmQWL3quTXd58nkNBMAccvTS5A VNroBNT8ctYWqSqMkOAtFoJ2/IPe0buyvA/skTk/Huyax5gBS1zLDk7XwiEVTANqTX swNoW3P5nuxiqcBk5XMFchi7yII2xudGkKetzTtlk+szG1fH0HCULfHWKZGBR2ZcdX CFOIqgV6/NMBQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 10 Dec 2023 19:41:59 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Olivia Mackall , Herbert Xu Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-crypto@vger.kernel.org Subject: [PATCH] hwrng: virtio - Remove usage of the deprecated ida_simple_xx() API Date: Sun, 10 Dec 2023 19:41:51 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). This is less verbose. Signed-off-by: Christophe JAILLET --- drivers/char/hw_random/virtio-rng.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c index 58d92d62ddfe..7a4b45393acb 100644 --- a/drivers/char/hw_random/virtio-rng.c +++ b/drivers/char/hw_random/virtio-rng.c @@ -135,7 +135,7 @@ static int probe_common(struct virtio_device *vdev) if (!vi) return -ENOMEM; - vi->index = index = ida_simple_get(&rng_index_ida, 0, 0, GFP_KERNEL); + vi->index = index = ida_alloc(&rng_index_ida, GFP_KERNEL); if (index < 0) { err = index; goto err_ida; @@ -166,7 +166,7 @@ static int probe_common(struct virtio_device *vdev) return 0; err_find: - ida_simple_remove(&rng_index_ida, index); + ida_free(&rng_index_ida, index); err_ida: kfree(vi); return err; @@ -184,7 +184,7 @@ static void remove_common(struct virtio_device *vdev) hwrng_unregister(&vi->hwrng); virtio_reset_device(vdev); vdev->config->del_vqs(vdev); - ida_simple_remove(&rng_index_ida, vi->index); + ida_free(&rng_index_ida, vi->index); kfree(vi); } -- 2.34.1