From: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
James Hogan <james.hogan@imgtec.com>,
Qais Yousef <Qais.Yousef@imgtec.com>
Subject: Re: [PATCH v2 2/4] PCI/quirks: Rename piix4_[io|mem]_quirk to add acpi
Date: Tue, 8 Oct 2013 18:45:16 -0700 [thread overview]
Message-ID: <5254B52C.1050500@imgtec.com> (raw)
In-Reply-To: <CAErSpo4mWXhfgvxWkYtD6GqtuSHZ26HZ0vTnf5NTZo6W+U04LQ@mail.gmail.com>
On 10/08/2013 04:14 PM, Bjorn Helgaas wrote:
> On Fri, Oct 4, 2013 at 5:30 PM, Deng-Cheng Zhu <dengcheng.zhu@imgtec.com> wrote:
>> From: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
>>
>> Rename piix4_[io|mem]_quirk to piix4_acpi_[io|mem]_quirk because these 2
>> functions only deal with the function 3 (power management) of PIIX4.
>>
>> Signed-off-by: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
>> Reviewed-by: James Hogan <james.hogan@imgtec.com>
> I don't really see the point in patches 2-4. We end up with 50 more
> lines of code. Most of this is new #defines. They do add names where
> before we only had numbers, which *sounds* attractive, but it looks
> like each #define is used only once, and it's in chipset-dependent
> code where a careful reader has to compare every line with the spec
> anyway. Adding a #define means you have to look at the definition,
> the use, and the spec. Without the #define, you only have to look at
> the code and the spec. I don't think it's worth it.
Sometimes (most of the time) reader doesn't want to dig into spec since the
code is already there and the device is working. Reader may only want to
know what the code is doing. The macros help (otherwise one can only know
that pci_read_config_dword is reading a config register and then the output
will be used to OR or AND). Variable names do give some hints, but macros
give additional info. Yes, many of them are used only once, but they help a
bit when used. Some examples are in the same file drivers/pci/quirks.c,
such as ICH*. And you can easily find other examples by grepping, e.g.
drivers/thermal/armada_thermal.c.
The above is about patch #4. About #2, it is an effort to make the code
have more sense, as explained in the commit message. It IS an improvement,
isn't it?
About #3, do you really think reusing the same logic by putting it in a
function is worthless?
Deng-Cheng
next prev parent reply other threads:[~2013-10-09 1:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-04 23:30 [PATCH v2 0/4] PCI/quirks: PIIX4 ACPI bugfix and cleanups Deng-Cheng Zhu
2013-10-04 23:30 ` [PATCH v2 1/4] PCI/quirks: Fix PIIX4 memory base and size mask Deng-Cheng Zhu
2013-10-05 2:13 ` Bjorn Helgaas
2013-10-05 3:42 ` DengCheng Zhu
2013-10-05 4:37 ` Bjorn Helgaas
2013-10-07 21:14 ` Deng-Cheng Zhu
2013-10-08 23:13 ` Bjorn Helgaas
2013-10-09 0:29 ` Deng-Cheng Zhu
2013-10-04 23:30 ` [PATCH v2 2/4] PCI/quirks: Rename piix4_[io|mem]_quirk to add acpi Deng-Cheng Zhu
2013-10-08 23:14 ` Bjorn Helgaas
2013-10-09 1:45 ` Deng-Cheng Zhu [this message]
2013-10-04 23:30 ` [PATCH v2 3/4] PCI/quirks: Extract the size detection logic of PIIX4 ACPI io and mem Deng-Cheng Zhu
2013-10-04 23:30 ` [PATCH v2 4/4] PCI/quirks: Convert hard-coded values to macros for PIIX4 ACPI quirks Deng-Cheng Zhu
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=5254B52C.1050500@imgtec.com \
--to=dengcheng.zhu@imgtec.com \
--cc=Qais.Yousef@imgtec.com \
--cc=bhelgaas@google.com \
--cc=james.hogan@imgtec.com \
--cc=linux-pci@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.