From 6f96d46f9a1ad1c02589b598c56ea881094129d8 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Wed, 2 Aug 2023 10:39:28 +0200 Subject: batman-adv: Drop per algo GW section class code This code was only used in the past for the sysfs interface. But since this was replace with netlink, it was never executed. The function pointer was only checked to figure out whether the limit 255 (B.A.T.M.A.N. IV) or 2**32-1 (B.A.T.M.A.N. V) should be used as limit. So instead of keeping the function pointer, just store the limits directly in struct batadv_algo_gw_ops. Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich --- net/batman-adv/netlink.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'net/batman-adv/netlink.c') diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c index b6c512ce6704..d37872b34281 100644 --- a/net/batman-adv/netlink.c +++ b/net/batman-adv/netlink.c @@ -548,15 +548,12 @@ static int batadv_netlink_set_mesh(struct sk_buff *skb, struct genl_info *info) * algorithm in use implements the GW API */ - u32 sel_class_max = 0xffffffffu; + u32 sel_class_max = bat_priv->algo_ops->gw.sel_class_max; u32 sel_class; attr = info->attrs[BATADV_ATTR_GW_SEL_CLASS]; sel_class = nla_get_u32(attr); - if (!bat_priv->algo_ops->gw.store_sel_class) - sel_class_max = BATADV_TQ_MAX_VALUE; - if (sel_class >= 1 && sel_class <= sel_class_max) { atomic_set(&bat_priv->gw.sel_class, sel_class); batadv_gw_reselect(bat_priv); -- cgit v1.2.3