From: Hiroshi Doyu <hdoyu@nvidia.com>
To: "swarren@wwwdotorg.org" <swarren@wwwdotorg.org>
Cc: "linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
"arnd@arndb.de" <arnd@arndb.de>,
"marvin24@gmx.de" <marvin24@gmx.de>,
"balbi@ti.com" <balbi@ti.com>,
"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [v2 3/3] ARM: tegra: Unify Device tree board files
Date: Tue, 12 Feb 2013 05:12:40 +0100 [thread overview]
Message-ID: <20130212.061240.2083183700176617607.hdoyu@nvidia.com> (raw)
In-Reply-To: <5119849B.1070300@wwwdotorg.org>
Stephen Warren <swarren@wwwdotorg.org> wrote @ Tue, 12 Feb 2013 00:54:03 +0100:
> > -obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra.o
> > -obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o
> > -obj-$(CONFIG_ARCH_TEGRA_114_SOC) += board-dt-tegra114.o
> > +obj-y += tegra.o
> > +
>
> I think I'd be tempted to move that line together with all the others
> that don't depend on some config option.
In arch/arm/mach-tegra/Makefile, we have:
obj-y += common.o
obj-y += io.o
obj-y += irq.o
obj-y += fuse.o
obj-y += pmc.o
.....
Should we have a single entry for them as well?
obj-y:= common.o io.o irq.o fuse.o pmc.o flowctrl.o powergate.o apbio.o pm.o \
reset.o reset-handler.o sleep.o tegra.o
I think that this moval could be done another patch.
> > static void __init harmony_init(void)
> > {
> > -#ifdef CONFIG_TEGRA_PCI
> > int ret;
> >
> > ret = harmony_pcie_init();
> > if (ret)
> > pr_err("harmony_pcie_init() failed: %d\n", ret);
> > -#endif
> > }
>
> Why drop those ifdefs? Does the code still compile (link) if built for
> Tegra30-only or Tegra114-only, where the Tegra PCI driver won't be
> enabled, and hence those functions don't exist?
This function itself will be dropped by the following IS_ENABLED().
> > static void __init paz00_init(void)
> > @@ -129,6 +128,9 @@ static void __init tegra_dt_init_late(void)
> >
> > tegra_init_late();
> >
> > + if (IS_ENABLED(CONFIG_PCI) && IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC))
> > + return;
>
> I don't think that's going to help any link issues, so I'd drop it and
> keep this function simple.
As explained in the above, a complier will drop unnecessary functions
automatically with this IS_ENABLED(), which could save many ifdefs.
> After all, what if someone wants to add some
> non-PCI-related entry into board_init_funcs[]?
I originally thought that one should try to solve those board specific
problems with DT basically and this tegra specific board_init_funcs[]
was left only for the legacy support during DT transition.
next prev parent reply other threads:[~2013-02-12 4:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-11 6:05 [v2 1/3] ARM: tegra: Unify tegra{20,30,114}_init_early() Hiroshi Doyu
2013-02-11 6:05 ` [v2 2/3] ARM: tegra: Rename board-dt-tegra20.c to tegra.c Hiroshi Doyu
2013-02-11 6:05 ` [v2 3/3] ARM: tegra: Unify Device tree board files Hiroshi Doyu
2013-02-11 23:54 ` Stephen Warren
2013-02-12 4:12 ` Hiroshi Doyu [this message]
2013-02-12 4:47 ` Stephen Warren
2013-02-12 5:04 ` Hiroshi Doyu
2013-02-12 13:50 ` Arnd Bergmann
2013-02-12 16:35 ` Stephen Warren
2013-02-12 17:32 ` Arnd Bergmann
2013-02-12 20:52 ` Stephen Warren
2013-02-12 22:25 ` Arnd Bergmann
2013-02-13 6:12 ` Hiroshi Doyu
2013-02-13 16:50 ` Stephen Warren
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=20130212.061240.2083183700176617607.hdoyu@nvidia.com \
--to=hdoyu@nvidia.com \
--cc=arnd@arndb.de \
--cc=balbi@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=marvin24@gmx.de \
--cc=swarren@wwwdotorg.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).