Thread (1 message) 1 message, 1 author, 2011-01-06
DORMANTno replies

[PATCH v2 2/5] omap2plus: prm: Trvial build break fix for undefined reference to 'omap2_prm_read_mod_reg'

From: Kevin Hilman <hidden>
Date: 2011-01-06 18:09:50
Also in: linux-omap

Santosh Shilimkar [off-list ref] writes:
quoted
-----Original Message-----
From: Premi, Sanjeev [mailto:premi at ti.com]
Sent: Thursday, January 06, 2011 8:03 PM
To: Shilimkar, Santosh; linux-omap at vger.kernel.org
Cc: Hilman, Kevin; tony at atomide.com; linux-arm-
kernel at lists.infradead.org; Shilimkar, Santosh; Paul Walmsley
Subject: RE: [PATCH v2 2/5] omap2plus: prm: Trvial build break fix
for undefined reference to 'omap2_prm_read_mod_reg'
quoted
-----Original Message-----
From: linux-omap-owner at vger.kernel.org
[mailto:linux-omap-owner at vger.kernel.org] On Behalf Of
Santosh Shilimkar
Sent: Wednesday, January 05, 2011 4:27 PM
To: linux-omap at vger.kernel.org
Cc: Hilman, Kevin; tony at atomide.com;
linux-arm-kernel at lists.infradead.org; Shilimkar, Santosh;
Paul Walmsley
Subject: [PATCH v2 2/5] omap2plus: prm: Trvial build break
fix for undefined reference to 'omap2_prm_read_mod_reg'
[snip]
quoted
 #ifndef __ASSEMBLER__
-
+/*
+ * Stub omap2xxx/omap3xxx functions so that common files
+ * continue to build when custom builds are used
+ */
+#if defined(CONFIG_ARCH_OMAP4) &&
!(defined(CONFIG_ARCH_OMAP2) ||	\
+					defined(CONFIG_ARCH_OMAP3))
+static inline u32 omap2_prm_read_mod_reg(s16 module, u16 idx)
+{
+	WARN_ONCE(1, "prm: omap2xxx/omap3xxx specific function and "
+		"not suppose to be used on omap4\n");
+	return 0;
+}
Looking forward, the warning of incorrect SOC may be required
for when kernel is build for one specific SOC.

Wouldn't it be easy/better to have common global function:

void wrong_soc(char* func, int soc_id)
{
	WARN_ONCE(1, "Function %s cannot be used for %d", func,
soc_id);
}

OR we could have soc specific functions e.g.

void omap2xxx_only (char* func)
{
	WARN_ONCE(1, "Function %s is specific to OMAP2XXX");
}
..etc..

Later these functions can be called from the stubs.

This is prelim idea, will need to be worked upon.
Not sure. May appear like over engineering considering it's a
stub.
Paul can comment.
I guess Sanjeev's approach is meant eliminate duplicate strings that
waste space.

Sanjeev, did you check whether multiple copies of the exact same string
actually exist in the binary?  I'm wondering if gcc is smart enough to
only have one copy of the string (but have doubts.)

Kevin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help