[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161128.000441.620877539663307124.davem@davemloft.net>
Date: Mon, 28 Nov 2016 00:04:41 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: rvatsavayi@...iumnetworks.com
Cc: netdev@...r.kernel.org, raghu.vatsavayi@...iumnetworks.com,
derek.chickles@...iumnetworks.com,
satananda.burla@...iumnetworks.com,
felix.manlunas@...iumnetworks.com
Subject: Re: [PATCH net-next 2/9] liquidio CN23XX: VF registration
From: Raghu Vatsavayi <rvatsavayi@...iumnetworks.com>
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.
Powered by blists - more mailing lists