diff mbox series

[net-next] net: fealnx: fix build for UML

Message ID 20211014050500.5620-1-rdunlap@infradead.org (mailing list archive)
State Accepted
Commit cd2621d07d517473611b170c69beb6524c677740
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: fealnx: fix build for UML | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present success Fixes tag not required for -next series
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers fail 1 blamed authors not CCed: johannes.berg@intel.com; 4 maintainers not CCed: tanghui20@huawei.com arnd@arndb.de johannes.berg@intel.com weiyongjun1@huawei.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Fixes tag looks correct
netdev/checkpatch warning CHECK: architecture specific defines should be avoided
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Randy Dunlap Oct. 14, 2021, 5:05 a.m. UTC
On i386, when builtin (not a loadable module), the fealnx driver
inspects boot_cpu_data to see what CPU family it is running on, and
then acts on that data. The "family" struct member (x86) does not exist
when running on UML, so prevent that test and do the default action.

Prevents this build error on UML + i386:

../drivers/net/ethernet/fealnx.c: In function ‘netdev_open’:
../drivers/net/ethernet/fealnx.c:861:19: error: ‘struct cpuinfo_um’ has no member named ‘x86’

Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: linux-um@lists.infradead.org
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/ethernet/fealnx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 15, 2021, 2:30 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 13 Oct 2021 22:05:00 -0700 you wrote:
> On i386, when builtin (not a loadable module), the fealnx driver
> inspects boot_cpu_data to see what CPU family it is running on, and
> then acts on that data. The "family" struct member (x86) does not exist
> when running on UML, so prevent that test and do the default action.
> 
> Prevents this build error on UML + i386:
> 
> [...]

Here is the summary with links:
  - [net-next] net: fealnx: fix build for UML
    https://git.kernel.org/netdev/net-next/c/cd2621d07d51

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

--- linux-next-20211013.orig/drivers/net/ethernet/fealnx.c
+++ linux-next-20211013/drivers/net/ethernet/fealnx.c
@@ -857,7 +857,7 @@  static int netdev_open(struct net_device
 	np->bcrvalue |= 0x04;	/* big-endian */
 #endif
 
-#if defined(__i386__) && !defined(MODULE)
+#if defined(__i386__) && !defined(MODULE) && !defined(CONFIG_UML)
 	if (boot_cpu_data.x86 <= 4)
 		np->crvalue = 0xa00;
 	else