Re: [PATCH net-next 2/9] liquidio CN23XX: VF registration
From: David Miller <davem@davemloft.net>
Date: 2016-11-28 05:04:43
From: David Miller <davem@davemloft.net>
Date: 2016-11-28 05:04:43
From: Raghu Vatsavayi <redacted> Date: Sun, 27 Nov 2016 20:51:35 -0800
+static int
+liquidio_vf_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent __attribute__((unused)))
+{
+ struct octeon_device *oct_dev = NULL;...
+ /* set linux specific device pointer */ + oct_dev->pci_dev = (void *)pdev; +
This is a terrible cast on several levels. The type is already correct, oct_dev->pci_dev and pdev are both "struct pci_dev *" Furthermore, even if oct_dev->pci_dev was "void *", void pointer casts are _never_ necessary on assignment from any other pointer type.