From: Ayaz Abdulla <aabdulla@nvidia.com>
To: David Miller <davem@davemloft.net>
Cc: "manfred@colorfullife.com" <manfred@colorfullife.com>,
"akpm@osdl.org" <akpm@osdl.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] forcedeth: Addition of new device id (resend without pci_ids.h)
Date: Wed, 03 Jun 2009 12:43:12 -0400 [thread overview]
Message-ID: <4A26A820.4040105@nvidia.com> (raw)
In-Reply-To: <20090603.145902.185480919.davem@davemloft.net>
David Miller wrote:
> From: Ayaz Abdulla <aabdulla@nvidia.com>
> Date: Wed, 03 Jun 2009 12:24:37 -0400
>
>
>>
>>David Miller wrote:
>>
>>>From: Ayaz Abdulla <aabdulla@nvidia.com>
>>>Date: Wed, 03 Jun 2009 12:06:04 -0400
>>>
>>>
>>>>Add support for new ethernet device in the MCP89 chipset.
>>>>
>>>>Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
>>>
>>>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...
prev parent reply other threads:[~2009-06-03 22:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-03 16:06 [PATCH] forcedeth: Addition of new device id (resend without pci_ids.h) Ayaz Abdulla
2009-06-03 21:44 ` David Miller
2009-06-03 16:24 ` Ayaz Abdulla
2009-06-03 21:59 ` David Miller
2009-06-03 16:43 ` Ayaz Abdulla [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A26A820.4040105@nvidia.com \
--to=aabdulla@nvidia.com \
--cc=akpm@osdl.org \
--cc=davem@davemloft.net \
--cc=manfred@colorfullife.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).