Skip to content

Commit 6c67775

Browse files
Arkadi Sharshevskydavem330
authored andcommitted
mlxsw: spectrum: Use NL_SET_ERR_MSG_MOD
Use NL_SET_ERR_MSG_MOD helper which adds the module name instead of specifying the prefix each time. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d520d58 commit 6c67775

File tree

3 files changed

+16
-24
lines changed

3 files changed

+16
-24
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum.c

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4236,13 +4236,11 @@ mlxsw_sp_master_lag_check(struct mlxsw_sp *mlxsw_sp,
42364236
u16 lag_id;
42374237

42384238
if (mlxsw_sp_lag_index_get(mlxsw_sp, lag_dev, &lag_id) != 0) {
4239-
NL_SET_ERR_MSG(extack,
4240-
"spectrum: Exceeded number of supported LAG devices");
4239+
NL_SET_ERR_MSG_MOD(extack, "Exceeded number of supported LAG devices");
42414240
return false;
42424241
}
42434242
if (lag_upper_info->tx_type != NETDEV_LAG_TX_TYPE_HASH) {
4244-
NL_SET_ERR_MSG(extack,
4245-
"spectrum: LAG device using unsupported Tx type");
4243+
NL_SET_ERR_MSG_MOD(extack, "LAG device using unsupported Tx type");
42464244
return false;
42474245
}
42484246
return true;
@@ -4484,8 +4482,7 @@ static int mlxsw_sp_netdevice_port_upper_event(struct net_device *lower_dev,
44844482
!netif_is_lag_master(upper_dev) &&
44854483
!netif_is_bridge_master(upper_dev) &&
44864484
!netif_is_ovs_master(upper_dev)) {
4487-
NL_SET_ERR_MSG(extack,
4488-
"spectrum: Unknown upper device type");
4485+
NL_SET_ERR_MSG_MOD(extack, "Unknown upper device type");
44894486
return -EINVAL;
44904487
}
44914488
if (!info->linking)
@@ -4494,33 +4491,28 @@ static int mlxsw_sp_netdevice_port_upper_event(struct net_device *lower_dev,
44944491
(!netif_is_bridge_master(upper_dev) ||
44954492
!mlxsw_sp_bridge_device_is_offloaded(mlxsw_sp,
44964493
upper_dev))) {
4497-
NL_SET_ERR_MSG(extack,
4498-
"spectrum: Enslaving a port to a device that already has an upper device is not supported");
4494+
NL_SET_ERR_MSG_MOD(extack, "Enslaving a port to a device that already has an upper device is not supported");
44994495
return -EINVAL;
45004496
}
45014497
if (netif_is_lag_master(upper_dev) &&
45024498
!mlxsw_sp_master_lag_check(mlxsw_sp, upper_dev,
45034499
info->upper_info, extack))
45044500
return -EINVAL;
45054501
if (netif_is_lag_master(upper_dev) && vlan_uses_dev(dev)) {
4506-
NL_SET_ERR_MSG(extack,
4507-
"spectrum: Master device is a LAG master and this device has a VLAN");
4502+
NL_SET_ERR_MSG_MOD(extack, "Master device is a LAG master and this device has a VLAN");
45084503
return -EINVAL;
45094504
}
45104505
if (netif_is_lag_port(dev) && is_vlan_dev(upper_dev) &&
45114506
!netif_is_lag_master(vlan_dev_real_dev(upper_dev))) {
4512-
NL_SET_ERR_MSG(extack,
4513-
"spectrum: Can not put a VLAN on a LAG port");
4507+
NL_SET_ERR_MSG_MOD(extack, "Can not put a VLAN on a LAG port");
45144508
return -EINVAL;
45154509
}
45164510
if (netif_is_ovs_master(upper_dev) && vlan_uses_dev(dev)) {
4517-
NL_SET_ERR_MSG(extack,
4518-
"spectrum: Master device is an OVS master and this device has a VLAN");
4511+
NL_SET_ERR_MSG_MOD(extack, "Master device is an OVS master and this device has a VLAN");
45194512
return -EINVAL;
45204513
}
45214514
if (netif_is_ovs_port(dev) && is_vlan_dev(upper_dev)) {
4522-
NL_SET_ERR_MSG(extack,
4523-
"spectrum: Can not put a VLAN on an OVS port");
4515+
NL_SET_ERR_MSG_MOD(extack, "Can not put a VLAN on an OVS port");
45244516
return -EINVAL;
45254517
}
45264518
break;
@@ -4633,7 +4625,7 @@ static int mlxsw_sp_netdevice_port_vlan_event(struct net_device *vlan_dev,
46334625
case NETDEV_PRECHANGEUPPER:
46344626
upper_dev = info->upper_dev;
46354627
if (!netif_is_bridge_master(upper_dev)) {
4636-
NL_SET_ERR_MSG(extack, "spectrum: VLAN devices only support bridge and VRF uppers");
4628+
NL_SET_ERR_MSG_MOD(extack, "VLAN devices only support bridge and VRF uppers");
46374629
return -EINVAL;
46384630
}
46394631
if (!info->linking)
@@ -4642,7 +4634,7 @@ static int mlxsw_sp_netdevice_port_vlan_event(struct net_device *vlan_dev,
46424634
(!netif_is_bridge_master(upper_dev) ||
46434635
!mlxsw_sp_bridge_device_is_offloaded(mlxsw_sp,
46444636
upper_dev))) {
4645-
NL_SET_ERR_MSG(extack, "spectrum: Enslaving a port to a device that already has an upper device is not supported");
4637+
NL_SET_ERR_MSG_MOD(extack, "Enslaving a port to a device that already has an upper device is not supported");
46464638
return -EINVAL;
46474639
}
46484640
break;

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ static struct mlxsw_sp_vr *mlxsw_sp_vr_create(struct mlxsw_sp *mlxsw_sp,
793793

794794
vr = mlxsw_sp_vr_find_unused(mlxsw_sp);
795795
if (!vr) {
796-
NL_SET_ERR_MSG(extack, "spectrum: Exceeded number of supported virtual routers");
796+
NL_SET_ERR_MSG_MOD(extack, "Exceeded number of supported virtual routers");
797797
return ERR_PTR(-EBUSY);
798798
}
799799
vr->fib4 = mlxsw_sp_fib_create(mlxsw_sp, vr, MLXSW_SP_L3_PROTO_IPV4);
@@ -5796,7 +5796,7 @@ static int mlxsw_sp_router_fib_rule_event(unsigned long event,
57965796
}
57975797

57985798
if (err < 0)
5799-
NL_SET_ERR_MSG(extack, "spectrum: FIB rules not supported. Aborting offload");
5799+
NL_SET_ERR_MSG_MOD(extack, "FIB rules not supported. Aborting offload");
58005800

58015801
return err;
58025802
}
@@ -6035,7 +6035,7 @@ mlxsw_sp_rif_create(struct mlxsw_sp *mlxsw_sp,
60356035

60366036
err = mlxsw_sp_rif_index_alloc(mlxsw_sp, &rif_index);
60376037
if (err) {
6038-
NL_SET_ERR_MSG(extack, "spectrum: Exceeded number of supported router interfaces");
6038+
NL_SET_ERR_MSG_MOD(extack, "Exceeded number of supported router interfaces");
60396039
goto err_rif_index_alloc;
60406040
}
60416041

drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,7 @@ mlxsw_sp_bridge_8021q_port_join(struct mlxsw_sp_bridge_device *bridge_device,
18191819
struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan;
18201820

18211821
if (is_vlan_dev(bridge_port->dev)) {
1822-
NL_SET_ERR_MSG(extack, "spectrum: Can not enslave a VLAN device to a VLAN-aware bridge");
1822+
NL_SET_ERR_MSG_MOD(extack, "Can not enslave a VLAN device to a VLAN-aware bridge");
18231823
return -EINVAL;
18241824
}
18251825

@@ -1885,7 +1885,7 @@ mlxsw_sp_bridge_8021d_port_join(struct mlxsw_sp_bridge_device *bridge_device,
18851885
u16 vid;
18861886

18871887
if (!is_vlan_dev(bridge_port->dev)) {
1888-
NL_SET_ERR_MSG(extack, "spectrum: Only VLAN devices can be enslaved to a VLAN-unaware bridge");
1888+
NL_SET_ERR_MSG_MOD(extack, "Only VLAN devices can be enslaved to a VLAN-unaware bridge");
18891889
return -EINVAL;
18901890
}
18911891
vid = vlan_dev_vlan_id(bridge_port->dev);
@@ -1895,7 +1895,7 @@ mlxsw_sp_bridge_8021d_port_join(struct mlxsw_sp_bridge_device *bridge_device,
18951895
return -EINVAL;
18961896

18971897
if (mlxsw_sp_port_is_br_member(mlxsw_sp_port, bridge_device->dev)) {
1898-
NL_SET_ERR_MSG(extack, "spectrum: Can not bridge VLAN uppers of the same port");
1898+
NL_SET_ERR_MSG_MOD(extack, "Can not bridge VLAN uppers of the same port");
18991899
return -EINVAL;
19001900
}
19011901

0 commit comments

Comments
 (0)