From nobody Thu Dec 25 05:07:28 2025 Received: from smtp.smtpout.orange.fr (smtp-14.smtpout.orange.fr [80.12.242.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D74A01FD2 for ; Sat, 20 Jan 2024 06:59:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705733944; cv=none; b=c4JZOpSjDEhq46jFhGq9Cy9KkHBguxmkw93fo5ZXXahG2Oyn69fMv2XnOb+yMs7RsrAv5sRICnFSoOwAW7upUp4yJDBWj4bXN1lCi3JGPOqrJNq9hlccWS0RmvyDzNPFm85U1xN2m7xWpFT9KDi8hew60wuhU2wMg9tc7OQun6s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705733944; c=relaxed/simple; bh=iLUdhhWo7aaI6NNBGbzsfYLNbVys8tgyc3bVY56Gjik=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ul8IapEfiNV6yzg7iHuaU44I1OhyHUfm+nHMTvrHD/9dO07Q0SvICwj74uA+zAMn8ivkx0p9hhA6Qvp+5/FIlRTDenQpqND05/EVoI1+jiKzxgc0cspMvKLReVwHAB3ey4ZX/367UPbgpRAERWh1wj+uwM11a7AP5hLeJ0sJ+GM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=HSIL+65R; arc=none smtp.client-ip=80.12.242.14 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="HSIL+65R" Received: from fedora.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id R5JcrkgoYBejiR5JdrgS2l; Sat, 20 Jan 2024 07:58:53 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1705733933; bh=swo29GFzf9xHjPXqHApVp1CpCySEKUtAyuh+ivXKxUQ=; h=From:To:Cc:Subject:Date; b=HSIL+65Rtj5Jv/agCYAK7LGEEezmUGxhWlpnklfHBQzQSvkYCVoQY8tEzYKv/hvN4 5ZuhOgIzYgV/GlzzYRLJZUrAB/nUqZ0LydGQMlLNyBV3ei0Hyap9Zfb/27JAgrTc4c bruPR+pQJw2oiWZ8ov+4owF5XS60KWO4l+c5nysTCk4PRCv41fPFOoMfLUO5jLHzM1 92j2radxR42JzL3myOoXxgtKf8I3uBaF0qv9WZHGw67b+i6lWu8yJPxgI+p1mudX76 +1t2pR3x1zIj7zo8E1OnmmZpE9zcw4GoommMUUPbSrMFJoT6TnpMgDxvxYiS0Exx1f J5riGI+tz7y4Q== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 20 Jan 2024 07:58:53 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Greg Kroah-Hartman , "Rafael J. Wysocki" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] platform-msi: Remove usage of the deprecated ida_simple_xx() API Date: Sat, 20 Jan 2024 07:58:46 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_max() is inclusive. So a -1 has been added when needed. Signed-off-by: Christophe JAILLET --- drivers/base/platform-msi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/base/platform-msi.c b/drivers/base/platform-msi.c index f37ad34c80ec..ca48d1f60865 100644 --- a/drivers/base/platform-msi.c +++ b/drivers/base/platform-msi.c @@ -172,8 +172,8 @@ static int platform_msi_alloc_priv_data(struct device *= dev, unsigned int nvec, if (!datap) return -ENOMEM; =20 - datap->devid =3D ida_simple_get(&platform_msi_devid_ida, - 0, 1 << DEV_ID_SHIFT, GFP_KERNEL); + datap->devid =3D ida_alloc_max(&platform_msi_devid_ida, + (1 << DEV_ID_SHIFT) - 1, GFP_KERNEL); if (datap->devid < 0) { err =3D datap->devid; kfree(datap); @@ -191,7 +191,7 @@ static void platform_msi_free_priv_data(struct device *= dev) struct platform_msi_priv_data *data =3D dev->msi.data->platform_data; =20 dev->msi.data->platform_data =3D NULL; - ida_simple_remove(&platform_msi_devid_ida, data->devid); + ida_free(&platform_msi_devid_ida, data->devid); kfree(data); } =20 --=20 2.43.0