Skip to content

Commit 027d4ca

Browse files
jpirkodavem330
authored andcommitted
netdevsim: assume CONFIG_NET_DEVLINK is always enabled
Since commit f6b19b3 ("net: devlink: select NET_DEVLINK from drivers") adds implicit select of NET_DEVLINK for netdevsim, the code does not have to deal with the case when CONFIG_NET_DEVLINK is not enabled. So remove the ifcase. Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c3d9a43 commit 027d4ca

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

drivers/net/netdevsim/Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@
33
obj-$(CONFIG_NETDEVSIM) += netdevsim.o
44

55
netdevsim-objs := \
6-
netdev.o \
6+
netdev.o devlink.o fib.o \
77

88
ifeq ($(CONFIG_BPF_SYSCALL),y)
99
netdevsim-objs += \
1010
bpf.o
1111
endif
1212

13-
ifneq ($(CONFIG_NET_DEVLINK),)
14-
netdevsim-objs += devlink.o fib.o
15-
endif
16-
1713
ifneq ($(CONFIG_XFRM_OFFLOAD),)
1814
netdevsim-objs += ipsec.o
1915
endif

drivers/net/netdevsim/netdevsim.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ struct netdevsim {
9797
bool bpf_xdpoffload_accept;
9898

9999
bool bpf_map_accept;
100-
#if IS_ENABLED(CONFIG_NET_DEVLINK)
101100
struct devlink *devlink;
102-
#endif
103101
struct nsim_ipsec ipsec;
104102
};
105103

@@ -138,7 +136,6 @@ nsim_bpf_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
138136
}
139137
#endif
140138

141-
#if IS_ENABLED(CONFIG_NET_DEVLINK)
142139
enum nsim_resource_id {
143140
NSIM_RESOURCE_NONE, /* DEVLINK_RESOURCE_ID_PARENT_TOP */
144141
NSIM_RESOURCE_IPV4,
@@ -160,25 +157,6 @@ void nsim_fib_exit(void);
160157
u64 nsim_fib_get_val(struct net *net, enum nsim_resource_id res_id, bool max);
161158
int nsim_fib_set_max(struct net *net, enum nsim_resource_id res_id, u64 val,
162159
struct netlink_ext_ack *extack);
163-
#else
164-
static inline int nsim_devlink_setup(struct netdevsim *ns)
165-
{
166-
return 0;
167-
}
168-
169-
static inline void nsim_devlink_teardown(struct netdevsim *ns)
170-
{
171-
}
172-
173-
static inline int nsim_devlink_init(void)
174-
{
175-
return 0;
176-
}
177-
178-
static inline void nsim_devlink_exit(void)
179-
{
180-
}
181-
#endif
182160

183161
#if IS_ENABLED(CONFIG_XFRM_OFFLOAD)
184162
void nsim_ipsec_init(struct netdevsim *ns);

0 commit comments

Comments
 (0)