]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: add new function hclge_get_speed_bit()
authorGuangbin Huang <huangguangbin2@huawei.com>
Sat, 28 Aug 2021 06:55:18 +0000 (14:55 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 28 Aug 2021 10:20:05 +0000 (11:20 +0100)
commit64a80204ac98642621cbab353a4ee346996eefb4
tree689179ee84695a26086d3174ee73d683c66f18c4
parent35bcf5742cd076d0074c530e4a3f01b036f7590c
net: hns3: add new function hclge_get_speed_bit()

Currently, function hclge_check_port_speed() uses switch/case statement
to get speed bit according to speed. To reuse this part of code and
improve code readability and maintainability, add a new function
hclge_get_speed_bit() to get speed bit according to map relationship
of speed and speed bit defined in array speed_bit_map.

Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h