Skip to content

Commit

Permalink
atlx: fix warning in drivers/net/atlx/atl2.c
Browse files Browse the repository at this point in the history
fix this warning:

  drivers/net/atlx/atl2.c: In function ‘atl2_request_irq’:
  drivers/net/atlx/atl2.c:644: warning: unused variable ‘err’

'err' is unused in the !CONFIG_PCI_MSI case.

Instead of further increasing the #ifdeffery in this function,
restructure the code a bit and get rid of the #ifdef. This
relies on the fact that pci_enable_msi() will always fail in
the !CONFIG_PCI_MSI case.

There should be no change in driver behavior.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ingo Molnar authored and David S. Miller committed Nov 26, 2008
1 parent 45555c0 commit a098397
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/net/atlx/atl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,15 +644,13 @@ static int atl2_request_irq(struct atl2_adapter *adapter)
int flags, err = 0;

flags = IRQF_SHARED;
#ifdef CONFIG_PCI_MSI
adapter->have_msi = true;
err = pci_enable_msi(adapter->pdev);
if (err)
adapter->have_msi = false;

if (adapter->have_msi)
flags &= ~IRQF_SHARED;
#endif

return request_irq(adapter->pdev->irq, &atl2_intr, flags, netdev->name,
netdev);
Expand Down

0 comments on commit a098397

Please sign in to comment.