Received: by 2002:a05:7412:8d23:b0:f7:29d7:fb05 with SMTP id bj35csp305466rdb; Sat, 16 Dec 2023 08:55:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJWRaDQIL3GiqIbaxTvgL9+SioIacmc+zdqYqlAAT+X9wPFwS54b/kvU+8u8gJjLV1jMY5 X-Received: by 2002:a05:6a20:f39c:b0:18b:89fa:e924 with SMTP id qr28-20020a056a20f39c00b0018b89fae924mr14824303pzb.52.1702745732355; Sat, 16 Dec 2023 08:55:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702745732; cv=none; d=google.com; s=arc-20160816; b=hdtdun/gEy1W99fSYG3WxE/YXcem+QqnnwygAh7PJB3Ez9oBpXoGCXz8uLqtBEHEm+ M3uA/6hKRS1RhZvg1txNCBoX5nXrBXy3sRDEpKlX3WvGTQ8f4KkcLt/kxBTJGqy6LfFr hx+OfgnYZ1A6xj1wgBQimSQEofJJd2BtuiJJ4bKKomquZzBWyOiOeabKoELJGa5oxRbf NzzcLOAlG1qnyH4PAUfhVNtVMvriI6P0My5RQzmjv75TAnBzOUiBimWHJGHLyr3Nfeft nkdBSl1FzHqH0d5bDxfR/lRcVCcwrsCQh7ma83cisLTzMgInzyJNlrjTTzBg7ogQMlIm K/Tg== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=WZUiXIzL+1Xu6VLydlUDdYsPfdAWNV1xrKK5PwkOP6U=; fh=OD+bdFRaxxvKVxEVGrLVu4zUYP1Y8Lns8J4nDE9kD8A=; b=ZnkYoXKHxuFDnJuVBaIh//6a6JegN5ZhZTtWOGhQ8M7+VZgYyuVP95raXhgq6BI7U5 AbI/oYOlOyQC9mxwKFK1h4LbCbPTAIsAy13Z+gOorv3mXugCxrX6Y637eL2Nuj+dvMbO zsePKhJlP1ytVqTZWuaXIAfTXyWxEsJ5lkchbkRScZxc7yZ/YvZpUDRiY45muMwLHiA8 Fu6r4miw5jMlEp6XjnjtnFK+ThwdH+r5sGTfKVohgUFYeySU/9bHQI8BRXqefU10vZZ6 SVjyoMfaoJtQTEB/UG91+dsdyh8BYJddS94bHsYMIl6pZw0aQz9J7xs+/MMuZme8jcyB S0pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=tN79UuHH; spf=pass (google.com: domain of linux-kernel+bounces-2286-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2286-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c18-20020aa78e12000000b006d28b802490si1847260pfr.222.2023.12.16.08.55.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:55:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2286-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=tN79UuHH; spf=pass (google.com: domain of linux-kernel+bounces-2286-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2286-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 335D52857EE for ; Sat, 16 Dec 2023 16:55:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA14230CE1; Sat, 16 Dec 2023 16:55:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="tN79UuHH" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4851F30357 for ; Sat, 16 Dec 2023 16:55:20 +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 EXpEryfYLLMHAEXpEr0s2X; Sat, 16 Dec 2023 17:47:41 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1702745261; bh=WZUiXIzL+1Xu6VLydlUDdYsPfdAWNV1xrKK5PwkOP6U=; h=From:To:Cc:Subject:Date; b=tN79UuHHlTwW6A2typtF5+qkXQaaeMWtvf7mFzssLvxbnxe7It0Ky5japWAhjuj4b guRsIEBzyOoyG4x1Yw6Ap+MOs6puK97GHapRIovBQvj+kWnXRZ0p7ftv+x7fpyntXz fU5QhEnpynGKQ6In0P6K9r4ZrF6rsDEEt2G7q8VksHPksdLod6imsCAvoYFnyhg3Dg sDA0U5vlPAmPgZ1reiqWYHvcZ5Rxgub44OT9kd1aRlysapJxOpFGMoYlTg3mNaPWhH NLdzuObSjGFIDQ/ZLwerrf1XZWs2fz8zGCwJ3Ck4RxoodIWJQSE0UOt3npPROeZKq6 E907+JCRlg2kA== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 16 Dec 2023 17:47:41 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Srinivas Kandagatla , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , alsa-devel@alsa-project.org Subject: [PATCH] slimbus: core: Remove usage of the deprecated ida_simple_xx() API Date: Sat, 16 Dec 2023 17:47:34 +0100 Message-Id: <8402a9a8a45937fe2e62617ff0c7408503692b20.1702745212.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 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(). Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_range() is inclusive. So change this change allows one more device. Previously address 0xFE was never used. Fixes: 46a2bb5a7f7e ("slimbus: core: Add slim controllers support") Signed-off-by: Christophe JAILLET --- /!\ Untested /!\ The change of behavior is motivated by the comment in drivers/slimbus/slimbus.h stating that /* Manager's logical address is set to 0xFF per spec */, so all other values, including 0xFE should be valid, IMHO. So considering this as a bug-fix, I added a Fixes tag. --- drivers/slimbus/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c index d43873bb5fe6..01cbd4621981 100644 --- a/drivers/slimbus/core.c +++ b/drivers/slimbus/core.c @@ -436,8 +436,8 @@ static int slim_device_alloc_laddr(struct slim_device *sbdev, if (ret < 0) goto err; } else if (report_present) { - ret = ida_simple_get(&ctrl->laddr_ida, - 0, SLIM_LA_MANAGER - 1, GFP_KERNEL); + ret = ida_alloc_max(&ctrl->laddr_ida, + SLIM_LA_MANAGER - 1, GFP_KERNEL); if (ret < 0) goto err; -- 2.34.1