Re: [PATCH v5 net-next 08/11] net/nebula-matrix: add vsi resource implementation

From
Andrew Lunn <andrew@lunn.ch>
Date
2026-02-28 20:50:27
Also in
linux-doc, lkml
Reply to
illusion.wang, 2026-02-26
quoted hunk ↗ jump to hunk
+static void nbl_hw_set_driver_status(struct nbl_hw_mgt *hw_mgt, bool active)
+{
+	u32 status = 0;
+
+	status = nbl_hw_rd32(hw_mgt, NBL_DRIVER_STATUS_REG);
No point initialising status if the first thing your do is assign to
it.
quoted hunk ↗ jump to hunk
+static int nbl_res_vsi_init_chip_module(struct nbl_resource_mgt *res_mgt)
+{
+	u8 eth_speed = res_mgt->resource_info->board_info.eth_speed;
+	u8 eth_num = res_mgt->resource_info->board_info.eth_num;
+	struct nbl_hw_ops *hw_ops = res_mgt->hw_ops_tbl->ops;
+	struct nbl_hw_mgt *p = res_mgt->hw_ops_tbl->priv;
+	int ret = 0;
+
+	ret = hw_ops->init_chip_module(p, eth_speed, eth_num);
Another example. Please review all the driver for such pointless
initialisation.

	Andrew
Thread (24 messages) 24 messages, 2 authors, last reply 2026-03-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help