]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ata: ahci: use hweight_long() to count port_map bits
authorTanZheng <tanzheng@kylinos.cn>
Thu, 28 May 2026 06:00:50 +0000 (14:00 +0800)
committerNiklas Cassel <cassel@kernel.org>
Mon, 1 Jun 2026 17:07:37 +0000 (19:07 +0200)
commitf80cea847028bb9eb1149badebf9f142d96b2e8b
tree914241c449eef6404276b47a894f5bc4af941b96
parentaa0ae1c35f7b3e9afed2324bed5f5c87ad55b92c
ata: ahci: use hweight_long() to count port_map bits

Replace the open loop used to calculate the number of set bits
in the port mapping with the `hweight_long()` function, which
simplifies the code without altering its functionality.

Signed-off-by: TanZheng <tanzheng@kylinos.cn>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
drivers/ata/libahci.c