Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp34288rdb; Fri, 5 Jan 2024 01:35:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IE2qP6o6PVK4S0y7etFwoXOOlimoJq7JnlPtA3wJynIMIuhMicfU2D7ghjcBegTEKYDhVSN X-Received: by 2002:a05:6214:76a:b0:67a:93fa:b333 with SMTP id f10-20020a056214076a00b0067a93fab333mr1920261qvz.26.1704447327972; Fri, 05 Jan 2024 01:35:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704447327; cv=none; d=google.com; s=arc-20160816; b=nOgsc2LLZJiJUaBiQw/le+X19zrXdCVxP1Bcar7PC5Kn8IBQXRZ7N13AfwHA5op8q2 89hAwyYE92QiYYeToi5D3nBb9WCovhgoA9dWFO6+WZVMOspmst5QMvX+IbQulNqrG/Gd wWGiDEgMX6CMc2uProz0YDk9uPgg3h2sEfdbodwdVtL76/hG3Hhf15EvvEIcvIJvowEN lJfkKjN7OpJlbCtUxjhBgU2jT2jV0g1uGbGrpt6JxiOH0esjSK/tJgp7qjdtVRa7HgVf nKkmoqTSk6uRJaqgo4xE1LZqGGarenEvAFnkJJe0QfNiaZk7h4Qap/nQPyJgYv7LyCUg 66Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=UNWAgG72CqrXdtBAJ+FNWG2kto2YDA/1pTgcQwka+VI=; fh=YSolgoSzsYPgPUg9lCWzHsn6whBmzo6aMpaqCeqBTLc=; b=G9b/5u9qwBbMpg+7ZzLkP41mr21UDSDH9MgOubwm8xR1FRJkMCB2QOHWqQIPzu4l9v 3p0z3gMOZgoS6d/2v6tJtPAZnnIS/fEAQpioBQP+HuVd8QcGHwcoepmx2/MLt5j6LS2n 0we0yB8KNO1VBrqQzJk4wSzGbPRy+f1B1pj0LzHRVrUJpICMNT6Y8IJ+y8VkjcDAkBRd T5ls+ZS6gq/Ayu0GN6/CGNYy9PdK5J5wSii9HQXZyBXi04bY2gZIq/fhPOjWchsFeE+c b3v8aATfNWfx8UwU0AgSKe56HWwiGoduheJ8s/xnnk0gE3PVpmeyO6MU9uN08kGyk8jN wRlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=lKkhwhSr; spf=pass (google.com: domain of linux-kernel+bounces-17664-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17664-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h12-20020a0cab0c000000b0067f2b0d0c60si1311247qvb.281.2024.01.05.01.35.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 01:35:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17664-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=lKkhwhSr; spf=pass (google.com: domain of linux-kernel+bounces-17664-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17664-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B67B91C22D7B for ; Fri, 5 Jan 2024 09:35:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 34D4924B4D; Fri, 5 Jan 2024 09:35:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="lKkhwhSr" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.smtpout.orange.fr (smtp-25.smtpout.orange.fr [80.12.242.25]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 18E3224B42 for ; Fri, 5 Jan 2024 09:35:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id LgU0rtez5ELO0LgU7rh96e; Fri, 05 Jan 2024 10:27:24 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1704446844; bh=UNWAgG72CqrXdtBAJ+FNWG2kto2YDA/1pTgcQwka+VI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lKkhwhSrDn69hiAMrqfNEGcDBu+hjcHBHvmLgWlD3XhybkD2TMKxjZOhx8vwjYLZO KDJsTMbzRhDehOQqn39m8kwvPbqjK4bAhGGNANlnYVWHtkDRx9hu4GPhZeDHKF1xw/ crY25q3MEt/XE5hn+HAVlT3reY4kPHVdl728AWoOKhFJm57SM+32cYJE7OUL5fIGmj aJlbDtv5Q43A5M2o8E86BjYRi6mz2hfZsdlDsScOFwUqWvqzTaes8O0gx6kRsRVDvt j7cV16p93jr4MN4/S0dEDaI/2RWOX7t+0sBoTtLCkJiuYAEXnIylA5NUn0EqPsx4de D40rup6OL6oyQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 05 Jan 2024 10:27:24 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: alexis.lothore@bootlin.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , netdev@vger.kernel.org Subject: [PATCH 2/2 net-next] ipvlan: Remove usage of the deprecated ida_simple_xx() API Date: Fri, 5 Jan 2024 10:27:09 +0100 Message-Id: <216fe71e690580aede0d3def17b767d9559edd3a.1704446747.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: <5adda8a3ce7af63bc980ba6b4b3fbfd6344e336b.1704446747.git.christophe.jaillet@wanadoo.fr> References: <5adda8a3ce7af63bc980ba6b4b3fbfd6344e336b.1704446747.git.christophe.jaillet@wanadoo.fr> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). This is less verbose. Note that the upper bound of ida_alloc_range() is inclusive while the one of ida_simple_get() was exclusive. So calls have been updated accordingly. Signed-off-by: Christophe JAILLET --- drivers/net/ipvlan/ipvlan_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index e080e4fc41e4..df7c43a109e1 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c @@ -605,11 +605,11 @@ int ipvlan_link_new(struct net *src_net, struct net_device *dev, * Assign IDs between 0x1 and 0xFFFE (used by the master) to each * slave link [see addrconf_ifid_eui48()]. */ - err = ida_simple_get(&port->ida, port->dev_id_start, 0xFFFE, - GFP_KERNEL); + err = ida_alloc_range(&port->ida, port->dev_id_start, 0xFFFD, + GFP_KERNEL); if (err < 0) - err = ida_simple_get(&port->ida, 0x1, port->dev_id_start, - GFP_KERNEL); + err = ida_alloc_range(&port->ida, 0x1, port->dev_id_start - 1, + GFP_KERNEL); if (err < 0) goto unregister_netdev; dev->dev_id = err; @@ -641,7 +641,7 @@ int ipvlan_link_new(struct net *src_net, struct net_device *dev, unlink_netdev: netdev_upper_dev_unlink(phy_dev, dev); remove_ida: - ida_simple_remove(&port->ida, dev->dev_id); + ida_free(&port->ida, dev->dev_id); unregister_netdev: unregister_netdevice(dev); return err; @@ -661,7 +661,7 @@ void ipvlan_link_delete(struct net_device *dev, struct list_head *head) } spin_unlock_bh(&ipvlan->addrs_lock); - ida_simple_remove(&ipvlan->port->ida, dev->dev_id); + ida_free(&ipvlan->port->ida, dev->dev_id); list_del_rcu(&ipvlan->pnode); unregister_netdevice_queue(dev, head); netdev_upper_dev_unlink(ipvlan->phy_dev, dev); -- 2.34.1