mirror of
https://github.com/torvalds/linux.git
synced 2024-12-04 10:01:41 +00:00
qed: remove an unneed NULL check on list iterator
The define for_each_pci_dev(d) is: while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) Thus, the list iterator 'd' is always non-NULL so it doesn't need to be checked. So just remove the unnecessary NULL check. Also remove the unnecessary initializer because the list iterator is always initialized. Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com> Link: https://lore.kernel.org/r/20220406015921.29267-1-xiam0nd.tong@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
6a62924c0a
commit
4daf5f1956
@ -161,11 +161,11 @@ EXPORT_SYMBOL(qed_vlan_get_ndev);
|
||||
|
||||
struct pci_dev *qed_validate_ndev(struct net_device *ndev)
|
||||
{
|
||||
struct pci_dev *pdev = NULL;
|
||||
struct net_device *upper;
|
||||
struct pci_dev *pdev;
|
||||
|
||||
for_each_pci_dev(pdev) {
|
||||
if (pdev && pdev->driver &&
|
||||
if (pdev->driver &&
|
||||
!strcmp(pdev->driver->name, "qede")) {
|
||||
upper = pci_get_drvdata(pdev);
|
||||
if (upper->ifindex == ndev->ifindex)
|
||||
|
Loading…
Reference in New Issue
Block a user