Thread (14 messages) 14 messages, 3 authors, 2016-11-28

Re: [PATCH net-next 2/9] liquidio CN23XX: VF registration

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help