]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: vlan: Make is_vlan_dev() a stub when VLAN is not configured
authorGal Pressman <gal@nvidia.com>
Mon, 16 Jun 2025 13:26:24 +0000 (16:26 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:23 +0000 (16:28 +0200)
commit8d1f4798c876c99c625a010eb68253e87a769997
tree8a67d1150d5dd2527cedcdd2c6bf42aaf030521b
parent63acb8e2662006fe316342ce91d88e367a53e6fb
net: vlan: Make is_vlan_dev() a stub when VLAN is not configured

[ Upstream commit 2de1ba0887e5d3bf02d7c212f380039b34e10aa3 ]

Add a stub implementation of is_vlan_dev() that returns false when
VLAN support is not compiled in (CONFIG_VLAN_8021Q=n).

This allows us to compile-out VLAN-dependent dead code when it is not
needed.

This also resolves the following compilation error when:
* CONFIG_VLAN_8021Q=n
* CONFIG_OBJTOOL=y
* CONFIG_OBJTOOL_WERROR=y

drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.o: error: objtool: parse_mirred.isra.0+0x370: mlx5e_tc_act_vlan_add_push_action() missing __noreturn in .c/.h or NORETURN() in noreturns.h

The error occurs because objtool cannot determine that unreachable BUG()
(which doesn't return) calls in VLAN code paths are actually dead code
when VLAN support is disabled.

Signed-off-by: Gal Pressman <gal@nvidia.com>
Link: https://patch.msgid.link/20250616132626.1749331-2-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/if_vlan.h