Skip to contentSkip to conversation

tegra-cpuidle: provide stub when !CONFIG_CPU_IDLE

PATCH In review Kyle McMartin 4 participants 4 messages Aug 26, 2013 – Aug 27, 2013 1 message not in the archive Tegra architecture support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tegra-cpuidle: provide stub when !CONFIG_CPU_IDLE

While poking at something using the for-3.12/* trees, I hit the
following compile error:
drivers/built-in.o: In function `tegra_pcie_map_irq':
/builddir/build/BUILD/kernel-3.10.fc20/linux-3.11.0-0.rc6.git4.1.fc20.armv7hl/drivers/pci/host/pci-tegra.c:640:
undefined reference to `tegra_cpuidle_pcie_irqs_in_use'
drivers/built-in.o: In function `tegra_msi_map':
/builddir/build/BUILD/kernel-3.10.fc20/linux-3.11.0-0.rc6.git4.1.fc20.armv7hl/drivers/pci/host/pci-tegra.c:1227:
undefined reference to `tegra_cpuidle_pcie_irqs_in_use'
make: *** [vmlinux] Error 1

Since our .config had CONFIG_CPU_IDLE off. We should probably provide an empty function to handle this to avoid cluttering up pci-tegra.c with conditionals.

include/linux/tegra-cpuidle.h +7 -0
@@ -14,6 +14,13 @@
 #ifndef __LINUX_TEGRA_CPUIDLE_H__
 #define __LINUX_TEGRA_CPUIDLE_H__
 
+#ifdef CONFIG_CPU_IDLE
 void tegra_cpuidle_pcie_irqs_in_use(void);
+#else
+static inline void tegra_cpuidle_pcie_irqs_in_use(void)
+{
+	return;
+}
+#endif
 
 #endif
#1 lore raw

PATCH 1/1 tegra-cpuidle: provide stub when !CONFIG_CPU_IDLE

Quoted 10 lines · Kyle McMartin

While poking at something using the for-3.12/* trees, I hit the
following compile error:
drivers/built-in.o: In function `tegra_pcie_map_irq':
/builddir/build/BUILD/kernel-3.10.fc20/linux-3.11.0-0.rc6.git4.1.fc20.armv7hl/drivers/pci/host/pci-tegra.c:640:
undefined reference to `tegra_cpuidle_pcie_irqs_in_use'
drivers/built-in.o: In function `tegra_msi_map':
/builddir/build/BUILD/kernel-3.10.fc20/linux-3.11.0-0.rc6.git4.1.fc20.armv7hl/drivers/pci/host/pci-tegra.c:1227:
undefined reference to `tegra_cpuidle_pcie_irqs_in_use'
make: *** [vmlinux] Error 1

Quoted 3 lines

Since our .config had CONFIG_CPU_IDLE off. We should probably provide an empty function to handle this to avoid cluttering up pci-tegra.c with conditionals.

Another approach would be to use if (IS_ENABLED(CPU_IDLE)) at the call site. I guess the approach in this patch is better than that though, since it doesn't pollute the callers with knowledge of when this function is available.

Thierry, if you're OK with this, I can forward it on to arm-soc.

#2 lore raw

PATCH 1/1 tegra-cpuidle: provide stub when !CONFIG_CPU_IDLE

Quoted 15 lines · Stephen Warren
Quoted 10 lines · Kyle McMartin

While poking at something using the for-3.12/* trees, I hit the
following compile error:
drivers/built-in.o: In function `tegra_pcie_map_irq':
/builddir/build/BUILD/kernel-3.10.fc20/linux-3.11.0-0.rc6.git4.1.fc20.armv7hl/drivers/pci/host/pci-tegra.c:640:
undefined reference to `tegra_cpuidle_pcie_irqs_in_use'
drivers/built-in.o: In function `tegra_msi_map':
/builddir/build/BUILD/kernel-3.10.fc20/linux-3.11.0-0.rc6.git4.1.fc20.armv7hl/drivers/pci/host/pci-tegra.c:1227:
undefined reference to `tegra_cpuidle_pcie_irqs_in_use'
make: *** [vmlinux] Error 1

Quoted 3 lines

Since our .config had CONFIG_CPU_IDLE off. We should probably provide an empty function to handle this to avoid cluttering up pci-tegra.c with conditionals.

Quoted 6 lines

Another approach would be to use if (IS_ENABLED(CPU_IDLE)) at the call site. I guess the approach in this patch is better than that though, since it doesn't pollute the callers with knowledge of when this function is available.

Thierry, if you're OK with this, I can forward it on to arm-soc.

I agree. The dummy seems like the better option. Feel free to add my Reviewed-by (in my reply to the original patch) when you forward.

Thanks,
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130827/464ff10d/attachment.sig>

A message that is not in the archive (sent off-list or not yet received): 20130826153050.GC8764-nxOev/[email protected]

Reviewed-by
#4 lore raw
Quoted 19 lines · Kyle McMartin

While poking at something using the for-3.12/* trees, I hit the
following compile error:
drivers/built-in.o: In function `tegra_pcie_map_irq':
/builddir/build/BUILD/kernel-3.10.fc20/linux-3.11.0-0.rc6.git4.1.fc20.armv7hl/drivers/pci/host/pci-tegra.c:640:
undefined reference to `tegra_cpuidle_pcie_irqs_in_use'
drivers/built-in.o: In function `tegra_msi_map':
/builddir/build/BUILD/kernel-3.10.fc20/linux-3.11.0-0.rc6.git4.1.fc20.armv7hl/drivers/pci/host/pci-tegra.c:1227:
undefined reference to `tegra_cpuidle_pcie_irqs_in_use'
make: *** [vmlinux] Error 1

Since our .config had CONFIG_CPU_IDLE off. We should probably provide an empty function to handle this to avoid cluttering up pci-tegra.c with conditionals.

include/linux/tegra-cpuidle.h line 22

Quoted 9 lines
include/linux/tegra-cpuidle.h +5 -0
@@ -14,6 +14,13 @@
 #ifndef __LINUX_TEGRA_CPUIDLE_H__
 #define __LINUX_TEGRA_CPUIDLE_H__
 
+#ifdef CONFIG_CPU_IDLE
 void tegra_cpuidle_pcie_irqs_in_use(void);
+#else
+static inline void tegra_cpuidle_pcie_irqs_in_use(void)
+{
+	return;

There's technically no need for this return statement, but either way the patch looks good, so: