From: slash.tmp@free.fr (Mason)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/2] PCI: Add tango PCIe host bridge support
Date: Thu, 25 May 2017 14:41:41 +0200 [thread overview]
Message-ID: <a7d4752f-001d-ba7e-07ff-435643a7e661@free.fr> (raw)
In-Reply-To: <1b0ec9c9-1036-619e-19c7-16818ca728e3@arm.com>
On 25/05/2017 14:23, Marc Zyngier wrote:
> On 25/05/17 13:00, Mason wrote:
>> On 25/05/2017 10:48, Marc Zyngier wrote:
>>> Please have some defines for these magic values.
>>
>> Typical driver do
>> #define MUX_OFFSET 0x48
>> and then access the register's value through
>> readl_relaxed(pcie->base + MUX_OFFSET);
>>
>> I can't do that because the registers were shuffled around
>> between revision 1 and revision 2. Thus, instead of an
>> explicitly-named macro (MUX_OFFSET), I used an explicitly-
>> named field (pcie->mux) and access the register's value
>> through readl_relaxed(pcie->mux);
>
> That doesn't prevent you from having a TANGO_V1_MUX_OFFSET define, which
> you can supplement with a V2 at some point.
>
>> This is equivalent to providing the offset definitions in the
>> init functions, instead of at the top of the file.
>
> Sorry, my brain parses text far better than hex number.
Well, the hex numbers do need to show up somewhere :-)
IIUC, you're saying that
#define MUX_OFFSET 0x48
is clearer than
pcie->mux = base + 0x48;
OK, I can accept that. Maybe our brains have been trained
to easily recognize and ingest the macro, or maybe it's
the caps, or maybe the fact that the statement does
several things (addition and assignment and hex).
Out of curiosity, how would you feel about
pcie->MUX_OFFSET = 0x48;
and then using
readl_relaxed(pcie->base + pcie->MUX_OFFSET);
It feels weird to me, I think mostly because it is
an unusual pattern.
Anyway, I'll add the macros, if that improves review and
maintenance.
Regards.
next prev parent reply other threads:[~2017-05-25 12:41 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-20 14:24 [PATCH v4 0/2] Tango PCIe controller support Marc Gonzalez
2017-04-20 14:28 ` [PATCH v4 1/2] PCI: Add tango MSI " Marc Gonzalez
2017-05-17 14:56 ` Marc Gonzalez
2017-05-23 17:03 ` Bjorn Helgaas
2017-05-23 17:54 ` Mason
2017-05-23 18:03 ` Robin Murphy
2017-05-23 19:15 ` Mason
2017-05-24 10:00 ` Robin Murphy
2017-05-24 10:22 ` Marc Zyngier
2017-05-31 14:18 ` Mason
2017-05-31 17:34 ` Bjorn Helgaas
2017-05-31 18:49 ` Mason
2017-05-31 19:00 ` Bjorn Helgaas
2017-05-31 19:12 ` Bjorn Helgaas
2017-05-31 19:27 ` Mason
2017-05-31 20:04 ` Bjorn Helgaas
2017-05-31 21:55 ` Mason
2017-05-25 8:37 ` Marc Zyngier
2017-05-31 7:32 ` Marc Gonzalez
2017-04-20 14:31 ` [PATCH v4 2/2] PCI: Add tango PCIe host bridge support Marc Gonzalez
2017-05-23 17:24 ` Bjorn Helgaas
2017-05-23 17:43 ` Mason
2017-05-23 18:35 ` Bjorn Helgaas
2017-05-23 19:29 ` Mason
2017-05-25 8:48 ` Marc Zyngier
2017-05-25 12:00 ` Mason
2017-05-25 12:23 ` Marc Zyngier
2017-05-25 12:41 ` Mason [this message]
2017-05-25 13:20 ` Marc Zyngier
2017-05-15 8:16 ` [PATCH v4 0/2] Tango PCIe controller support Marc Gonzalez
2017-05-23 17:17 ` Bjorn Helgaas
2017-05-23 18:07 ` Mason
2017-05-23 18:30 ` Bjorn Helgaas
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=a7d4752f-001d-ba7e-07ff-435643a7e661@free.fr \
--to=slash.tmp@free.fr \
--cc=linux-arm-kernel@lists.infradead.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