From patchwork Wed Nov 1 09:41:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 160494 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp290659vqx; Wed, 1 Nov 2023 02:41:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG4KHxD7JQt4u2ebGM+7gIU8FZHRFRkuZ6LoyDH/GME5reqro4Dr5bxG1ln9kroqi5G8Vde X-Received: by 2002:a05:6870:d95:b0:1e9:e97e:24e5 with SMTP id mj21-20020a0568700d9500b001e9e97e24e5mr17198250oab.20.1698831698059; Wed, 01 Nov 2023 02:41:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698831698; cv=none; d=google.com; s=arc-20160816; b=Zc9QZRqhx7Pg9IqIKEKCUc1tJILMnhvtbD02wJRWAgFiNyk0S9cArh1fZP8bhe4lCo 1tyhCy+Z30GasnS3JtcpluR1/gLNchvrDtGyzGJ+Y5iI1LtAdCkPHoFjJtrZ4v+6pBEQ XqzNZXajNQI6PEcUKbAQV7TiRJkDfwb6twXZ7S6KFsVV83zewygcZl/PvM62qLzKOuqL qLdq13nNULylCCxUuqJmUg5yWQKAIf03B+VrLY/Yo/fs6jnvEw6jxzaCUDsOodxXR3ow HZ3xW2A3h0lwCy3Y0bOColYPGOpLbOg5NgsYOjPGDGC/Z5PqP6fcpzl8zScegaVWwmI/ 7j4g== 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:dkim-signature; bh=lci7+3XvwKBuDxgeW1wZiQqQ9+xbVFXx8gAOWcltF4c=; fh=Vr5I1v0m1TrNab9t3h2faMkZUUNQoj6WjRvdN97epB0=; b=soOiKYgngyB2rM1NkpJGvXKS5yub3EeGFMqBUIuVCNZxT7IzcTDSyH8Uh/Wz9lr6YL uuux0IrN67lJqJ5WEs44bcW/Ens9zzGwCpkidqz+9eJjm6RlSCjjrG8F3pgA9Vma80tf rVW6zhUi1eU8+ul/UJYntQw1hqg4yAuxTHN6wRhhKX40lwESJMYA+gD/K3dPcTY6AYbH EeUiXVHcYbpQtbE2EoDBnvmgVEX1kSxF+2B3FrLyhz6oWCdlP4PWviXjuQ7qOGHBCuDT Zw2EnkGRaoH/ja+avVhAcmGto0zqXhrRO+uoTlU+i2I/A2EQGwYyUTzWibyaOTI7V3RY 2KXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b="ZuWrnT+/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id bw41-20020a056a0204a900b0056a36ac322fsi2728593pgb.514.2023.11.01.02.41.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 02:41:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b="ZuWrnT+/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B8EE580621EA; Wed, 1 Nov 2023 02:41:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231510AbjKAJl0 (ORCPT + 35 others); Wed, 1 Nov 2023 05:41:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231411AbjKAJlX (ORCPT ); Wed, 1 Nov 2023 05:41:23 -0400 Received: from smtp.smtpout.orange.fr (smtp-14.smtpout.orange.fr [80.12.242.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70514DA for ; Wed, 1 Nov 2023 02:41:21 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id y7ixqyFEudFbKy7ixqnEFP; Wed, 01 Nov 2023 10:41:19 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1698831679; bh=lci7+3XvwKBuDxgeW1wZiQqQ9+xbVFXx8gAOWcltF4c=; h=From:To:Cc:Subject:Date; b=ZuWrnT+/z6mhaRO+RjEg7sfHBiks0kwfbkKTfXvCeJDOBJrVbBfXue2PRK7hml0nq hnUBezI3CTTXVRZn4Y1OjI05wCe2qDYx5CPE+kGx0oljosiIzaAFN8BAwJW0BNHfu7 8mUnoVjyjAu8/9lPRRnOrsNhr4rx4FE1Pvoex6IYmsK0J/o1BW+HsXWzjF/RKrm9GD IfsLshZMz8GB+vLGU/5LBRpiQsNJJSHby+PpJiDJ43rrfQVOKpwTZFNXNgxgTnbFTU 8suae4HiKPcn41G9tJ9ibzUsZpCvr4p5EPI9PDIzpt9GAT4nFyQOYAk3niCnGnjlkn /mDrT5XRbr5Ew== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 01 Nov 2023 10:41:19 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Vaibhav Gupta , Jens Taprogge , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , industrypack-devel@lists.sourceforge.net Subject: [PATCH] ipack: Remove usage of the deprecated ida_simple_xx() API Date: Wed, 1 Nov 2023 10:41:17 +0100 Message-Id: <435bd17b8a5ddb2fc3e42e2796117ee02263d02a.1698831664.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 01 Nov 2023 02:41:35 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781354146511653471 X-GMAIL-MSGID: 1781354146511653471 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 Acked-by: Vaibhav Gupta --- drivers/ipack/ipack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ipack/ipack.c b/drivers/ipack/ipack.c index cc1ecfd49928..b1471ba016a5 100644 --- a/drivers/ipack/ipack.c +++ b/drivers/ipack/ipack.c @@ -207,7 +207,7 @@ struct ipack_bus_device *ipack_bus_register(struct device *parent, int slots, if (!bus) return NULL; - bus_nr = ida_simple_get(&ipack_ida, 0, 0, GFP_KERNEL); + bus_nr = ida_alloc(&ipack_ida, GFP_KERNEL); if (bus_nr < 0) { kfree(bus); return NULL; @@ -237,7 +237,7 @@ int ipack_bus_unregister(struct ipack_bus_device *bus) { bus_for_each_dev(&ipack_bus_type, NULL, bus, ipack_unregister_bus_member); - ida_simple_remove(&ipack_ida, bus->bus_nr); + ida_free(&ipack_ida, bus->bus_nr); kfree(bus); return 0; }