Re: [PATCH net-next v04 06/14] hinic3: Nic_io initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/09/2025 09:28, Fan Gong wrote:
Add nic_io initialization to enable NIC service, initialize function table
and negotiate activation of NIC features.

[...]

+static DEFINE_IDA(hinic3_adev_ida);
+
+static int hinic3_adev_idx_alloc(void)
+{
+	return ida_alloc(&hinic3_adev_ida, GFP_KERNEL);
+}
+
+static void hinic3_adev_idx_free(int id)
+{
+	ida_free(&hinic3_adev_ida, id);
+}
+
  int hinic3_init_hwdev(struct pci_dev *pdev)
  {
  	struct hinic3_pcidev *pci_adapter = pci_get_drvdata(pdev);
@@ -451,6 +463,7 @@ int hinic3_init_hwdev(struct pci_dev *pdev)
  	hwdev->pdev = pci_adapter->pdev;
  	hwdev->dev = &pci_adapter->pdev->dev;
  	hwdev->func_state = 0;
+	hwdev->dev_id = hinic3_adev_idx_alloc();

Why do you need dev_id? It's not used anywhere in the patchset. The
commit doesn't explain it neither...





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux