diff options
| author | Fan Gong <gongfan1@huawei.com> | 2026-01-29 12:01:09 +0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-01-29 18:50:07 -0800 |
| commit | 34bef6a4960f7761bcf8bb8ef8cd6d0041ae0c69 (patch) | |
| tree | a1d61b7ad65d448f5e838d8860bbf97f99b81a63 /drivers | |
| parent | 738ff2d2f50221905c346b969aecc2fbaa5decaf (diff) | |
hinic3: Remove defensive txq_num check
Since commit 1f3838b84a63 ("hinic3: Add Rss function") nic_dev->num_txqs
cannot be zero in hinic3_alloc_txqs(). So remove the check for this case.
Link: https://lore.kernel.org/netdev/20250902180843.5ba05bf2@kernel.org/
Co-developed-by: Zhu Yikai <zhuyikai1@h-partners.com>
Signed-off-by: Zhu Yikai <zhuyikai1@h-partners.com>
Signed-off-by: Fan Gong <gongfan1@huawei.com>
Link: https://patch.msgid.link/c23daa9b79fa731c1caaec9b8245f6b2c4994afb.1769656467.git.zhuyikai1@h-partners.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/ethernet/huawei/hinic3/hinic3_tx.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c b/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c index 4e361c9bd043..6d3dc930ca97 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c @@ -44,16 +44,10 @@ static void hinic3_txq_stats_init(struct hinic3_txq *txq) int hinic3_alloc_txqs(struct net_device *netdev) { struct hinic3_nic_dev *nic_dev = netdev_priv(netdev); - struct hinic3_hwdev *hwdev = nic_dev->hwdev; u16 q_id, num_txqs = nic_dev->max_qps; struct pci_dev *pdev = nic_dev->pdev; struct hinic3_txq *txq; - if (!num_txqs) { - dev_err(hwdev->dev, "Cannot allocate zero size txqs\n"); - return -EINVAL; - } - nic_dev->txqs = kcalloc(num_txqs, sizeof(*nic_dev->txqs), GFP_KERNEL); if (!nic_dev->txqs) return -ENOMEM; |
