]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: phy: fixed_phy: replace IDA with a bitmap
authorHeiner Kallweit <hkallweit1@gmail.com>
Sun, 11 Jan 2026 12:43:22 +0000 (13:43 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 14 Jan 2026 02:58:49 +0000 (18:58 -0800)
commitca8934f80c4f386a08a4e6132a8943a8b0380ec7
treedfda4f2d9b19d79bf73fba0c41bb88c55a6d92c0
parent511cb45260228e19c4659d67251267d5dadceaac
net: phy: fixed_phy: replace IDA with a bitmap

Size of array fmb_fixed_phys is small, so we can use a simple bitmap
instead of an IDA to manage dynamic allocation of fixed PHY's.
find_first_zero_bit() isn't atomic, so we need the loop to rule out
double allocation of a PHY address.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/d4614463-d532-41fc-92e9-ef97107aceb5@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/fixed_phy.c