[PATCH] forcedeth: Addition of new device id (resend without pci_ids.h)

STALE6313d

5 messages, 2 authors, 2009-06-03 · open the first message on its own page

[PATCH] forcedeth: Addition of new device id (resend without pci_ids.h)

From: Ayaz Abdulla <hidden>
Date: 2009-06-03 21:38:29

Add support for new ethernet device in the MCP89 chipset.

Signed-off-by: Ayaz Abdulla <redacted>

Re: [PATCH] forcedeth: Addition of new device id (resend without pci_ids.h)

From: David Miller <davem@davemloft.net>
Date: 2009-06-03 21:44:55

From: Ayaz Abdulla <redacted>
Date: Wed, 03 Jun 2009 12:06:04 -0400
Add support for new ethernet device in the MCP89 chipset.

Signed-off-by: Ayaz Abdulla <redacted>
Just use the constant directly, please :-)

The new macro is completely superfluous.

Trust me, other drivers just use the PCI ID constant directly in their
tables too, and no animals were harmed by the experiment :-)

Re: [PATCH] forcedeth: Addition of new device id (resend without pci_ids.h)

From: Ayaz Abdulla <hidden>
Date: 2009-06-03 21:57:02


David Miller wrote:
From: Ayaz Abdulla <redacted>
Date: Wed, 03 Jun 2009 12:06:04 -0400

quoted
Add support for new ethernet device in the MCP89 chipset.

Signed-off-by: Ayaz Abdulla <redacted>

Just use the constant directly, please :-)
But there is place in the patch that refers to device id so it makes 
more sense to have a macro. i.e

+       if (np->device_id != PCI_DEVICE_ID_NVIDIA_NVENET_40)

other places in the code also refer to device ids for certain 
workarounds. i.e.

		if ((id->device == PCI_DEVICE_ID_NVIDIA_NVENET_12 ||
		     id->device == PCI_DEVICE_ID_NVIDIA_NVENET_13) &&


The new macro is completely superfluous.

Trust me, other drivers just use the PCI ID constant directly in their
tables too, and no animals were harmed by the experiment :-)

Re: [PATCH] forcedeth: Addition of new device id (resend without pci_ids.h)

From: David Miller <davem@davemloft.net>
Date: 2009-06-03 21:59:01

From: Ayaz Abdulla <redacted>
Date: Wed, 03 Jun 2009 12:24:37 -0400

David Miller wrote:
quoted
From: Ayaz Abdulla <redacted>
Date: Wed, 03 Jun 2009 12:06:04 -0400
quoted
Add support for new ethernet device in the MCP89 chipset.

Signed-off-by: Ayaz Abdulla <redacted>
Just use the constant directly, please :-)
But there is place in the patch that refers to device id so it makes
more sense to have a macro. i.e

+       if (np->device_id != PCI_DEVICE_ID_NVIDIA_NVENET_40)

other places in the code also refer to device ids for certain
workarounds. i.e.

		if ((id->device == PCI_DEVICE_ID_NVIDIA_NVENET_12 ||
		     id->device == PCI_DEVICE_ID_NVIDIA_NVENET_13) &&
And you can add the define when that is necessary.

Otherwise, it's being used in exactly one location, the ID table.
And for that purpose it's superfluous.

You could also change the driver to use a bitmask of HW workaround
cases, that gets set very early in the probe.  And the HW
workarounds are keyed on those bit masks (one test) compared
to the direct ID checks (potentially multiple compares).

It would be both cleaner and more efficient.  And you could still
use the direct constants without any real loss of clarity.

Re: [PATCH] forcedeth: Addition of new device id (resend without pci_ids.h)

From: Ayaz Abdulla <hidden>
Date: 2009-06-03 22:16:03


David Miller wrote:
From: Ayaz Abdulla <redacted>
Date: Wed, 03 Jun 2009 12:24:37 -0400

quoted
David Miller wrote:
quoted
From: Ayaz Abdulla <redacted>
Date: Wed, 03 Jun 2009 12:06:04 -0400

quoted
Add support for new ethernet device in the MCP89 chipset.

Signed-off-by: Ayaz Abdulla <redacted>
Just use the constant directly, please :-)
But there is place in the patch that refers to device id so it makes
more sense to have a macro. i.e

+       if (np->device_id != PCI_DEVICE_ID_NVIDIA_NVENET_40)

other places in the code also refer to device ids for certain
workarounds. i.e.

	if ((id->device == PCI_DEVICE_ID_NVIDIA_NVENET_12 ||
	     id->device == PCI_DEVICE_ID_NVIDIA_NVENET_13) &&

And you can add the define when that is necessary.

Otherwise, it's being used in exactly one location, the ID table.
And for that purpose it's superfluous.

You could also change the driver to use a bitmask of HW workaround
cases, that gets set very early in the probe.  And the HW
workarounds are keyed on those bit masks (one test) compared
to the direct ID checks (potentially multiple compares).

It would be both cleaner and more efficient.  And you could still
use the direct constants without any real loss of clarity.
Ok, I will do that in next patch...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help