Skip to contentSkip to conversation

hamradio: baycom_epp: fix build for UML

PATCH Applied Randy Dunlap 2 participants 2 messages Oct 15, 2021 – Oct 18, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hamradio: baycom_epp: fix build for UML

On i386, the baycom_epp driver wants to inspect X86 CPU features (TSC) and then act on that data, but that info is not available when running on UML, so prevent that test and do the default action.

Prevents this build error on UML + i386:

../drivers/net/hamradio/baycom_epp.c: In function ‘epp_bh’:
../drivers/net/hamradio/baycom_epp.c:630:6: error: implicit declaration of function ‘boot_cpu_has’; did you mean ‘get_cpu_mask’? [-Werror=implicit-function-declaration]

  if (boot_cpu_has(X86_FEATURE_TSC))   \
      ^

../drivers/net/hamradio/baycom_epp.c:658:2: note: in expansion of macro ‘GETTICK’
GETTICK(time1);

Fixes 68f5d3f3b654 ("um: add PCI over virtio emulation driver")
Cc Jeff Dike <[email protected]>
Cc Richard Weinberger <[email protected]>
Cc Anton Ivanov <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Thomas Sailer <[email protected]>
---
 drivers/net/hamradio/baycom_epp.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/hamradio/baycom_epp.c +3 -3
@@ -623,16 +623,16 @@ static int receive(struct net_device *de
 
 /* --------------------------------------------------------------------- */
 
-#ifdef __i386__
+#if defined(__i386__) && !defined(CONFIG_UML)
 #include <asm/msr.h>
 #define GETTICK(x)						\
 ({								\
 	if (boot_cpu_has(X86_FEATURE_TSC))			\
 		x = (unsigned int)rdtsc();			\
 })
-#else /* __i386__ */
+#else /* __i386__  && !CONFIG_UML */
 #define GETTICK(x)
-#endif /* __i386__ */
+#endif /* __i386__  && !CONFIG_UML */
 
 static void epp_bh(struct work_struct *work)
 {
#1 lore raw
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

Quoted 6 lines · On Thu, 14 Oct 2021 19:18:04 -0700 you wrote:

On i386, the baycom_epp driver wants to inspect X86 CPU features (TSC) and then act on that data, but that info is not available when running on UML, so prevent that test and do the default action.

Prevents this build error on UML + i386:

Quoted 8 lines

../drivers/net/hamradio/baycom_epp.c: In function ‘epp_bh’:
../drivers/net/hamradio/baycom_epp.c:630:6: error: implicit declaration of function ‘boot_cpu_has’; did you mean ‘get_cpu_mask’? [-Werror=implicit-function-declaration]

  if (boot_cpu_has(X86_FEATURE_TSC))   \
      ^

../drivers/net/hamradio/baycom_epp.c:658:2: note: in expansion of macro ‘GETTICK’
GETTICK(time1);

[...]

Here is the summary with links:
- [net] hamradio: baycom_epp: fix build for UML

    https://git.kernel.org/netdev/net/c/0a9bb11a5e29

You are awesome, thank you!