Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88E53C10F0E for ; Tue, 9 Apr 2019 15:15:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B6422084F for ; Tue, 9 Apr 2019 15:15:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20150623.gappssmtp.com header.i=@resnulli-us.20150623.gappssmtp.com header.b="ny84ynfI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726624AbfDIPPf (ORCPT ); Tue, 9 Apr 2019 11:15:35 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:38449 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726494AbfDIPPf (ORCPT ); Tue, 9 Apr 2019 11:15:35 -0400 Received: by mail-wr1-f67.google.com with SMTP id k11so21439687wro.5 for ; Tue, 09 Apr 2019 08:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=i8NNyyFRee/OSAVm6g6XlJCpmfdoUuCKbGA3yIrwpkk=; b=ny84ynfIkak34TaTIuwfPM2KdlvEahLNZ2wOYXMtEYpb0PrGaZunJ1fJTnfdpCzZYs LuRQEtW+R6UvEjt4ekH25xnTBpiG8bghzf/a2ooohV4RUjlvAtEdMHPN44OxjiEpfd3a UGC1eDLQ0Ut1La2PZT6hWzZ1GVIRzM56llBLlmeSXYjIYyLX1FBX2XJ+AwZeJvpv62Wj hqDJAIwL/1AbjXNZaVPqZ3s2fy81NfdCtW2/2RMWFZ9NV3p6L0q4gb21dxJmSHj4wp0t /hwXeJhPa5RLTEJjSC7XnYpem34GG3Dgegteqog/DYNx6nV7MLGOiWFzMmJlGCwkrVpZ +g+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=i8NNyyFRee/OSAVm6g6XlJCpmfdoUuCKbGA3yIrwpkk=; b=CI8WhAYuYMv3Y1MuLFkKU+C2k6Q8SJDW2gEDR4EN4ub2dFqF4hNSsZRl8OLx+Tl7Q0 0UBY7ks2srUK1XE1iPR9/eeDeaVfo8fJf2NouWew+LUlye0LOKovijjUzWcjdSFR57AC cbOsD4vzMVpzwia5BW42zwKS32IE8CjVSNF6fzKZ//qzKCEkCY7HXgVmn5LX+Yr74nqI RakivaFBLXm6HSSHRPFLskBNSduzljjL4XE0bF1Mh4d7c8bOTFaEfWKXEsQIbRrf/7/3 0eqhINhaZ4UJqkyY0ogohO6fagc2FDiB026Ts4PwpFtYZSobJV7PAgbgEn0J5j1vumw4 ShPw== X-Gm-Message-State: APjAAAXuaICcRNIwQWOW9GZQBefX/Oy7gC4hreI1uhUBkW8Ci9kdHrjN Puqp6o2InHR3vt+UZOt7dBrPDD0qWNg= X-Google-Smtp-Source: APXvYqwpECfpE5incxXx36sTc69+xBqdcB8/Yx//ciMtHkvqv/Fz84sw9DMBwRXVz1+LAGiqOnQJPA== X-Received: by 2002:a5d:4492:: with SMTP id j18mr23968240wrq.212.1554822933066; Tue, 09 Apr 2019 08:15:33 -0700 (PDT) Received: from localhost (amit2.rozhled.cz. [83.167.225.161]) by smtp.gmail.com with ESMTPSA id v190sm36185578wme.18.2019.04.09.08.15.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2019 08:15:32 -0700 (PDT) From: Jiri Pirko To: netdev@vger.kernel.org Cc: davem@davemloft.net, mlxsw@mellanox.com, jakub.kicinski@netronome.com Subject: [patch net-next 3/3] netdevsim: assume CONFIG_NET_DEVLINK is always enabled Date: Tue, 9 Apr 2019 17:14:54 +0200 Message-Id: <20190409151454.14097-4-jiri@resnulli.us> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190409151454.14097-1-jiri@resnulli.us> References: <20190409151454.14097-1-jiri@resnulli.us> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jiri Pirko Since commit f6b19b354d50 ("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 --- drivers/net/netdevsim/Makefile | 6 +----- drivers/net/netdevsim/netdevsim.h | 22 ---------------------- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/drivers/net/netdevsim/Makefile b/drivers/net/netdevsim/Makefile index 0fee1d06c084..0e67457156eb 100644 --- a/drivers/net/netdevsim/Makefile +++ b/drivers/net/netdevsim/Makefile @@ -3,17 +3,13 @@ obj-$(CONFIG_NETDEVSIM) += netdevsim.o netdevsim-objs := \ - netdev.o \ + netdev.o devlink.o fib.o \ ifeq ($(CONFIG_BPF_SYSCALL),y) netdevsim-objs += \ bpf.o endif -ifneq ($(CONFIG_NET_DEVLINK),) -netdevsim-objs += devlink.o fib.o -endif - ifneq ($(CONFIG_XFRM_OFFLOAD),) netdevsim-objs += ipsec.o endif diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h index 384c254fafc5..f04050bcb177 100644 --- a/drivers/net/netdevsim/netdevsim.h +++ b/drivers/net/netdevsim/netdevsim.h @@ -97,9 +97,7 @@ struct netdevsim { bool bpf_xdpoffload_accept; bool bpf_map_accept; -#if IS_ENABLED(CONFIG_NET_DEVLINK) struct devlink *devlink; -#endif struct nsim_ipsec ipsec; }; @@ -138,7 +136,6 @@ nsim_bpf_setup_tc_block_cb(enum tc_setup_type type, void *type_data, } #endif -#if IS_ENABLED(CONFIG_NET_DEVLINK) enum nsim_resource_id { NSIM_RESOURCE_NONE, /* DEVLINK_RESOURCE_ID_PARENT_TOP */ NSIM_RESOURCE_IPV4, @@ -160,25 +157,6 @@ void nsim_fib_exit(void); u64 nsim_fib_get_val(struct net *net, enum nsim_resource_id res_id, bool max); int nsim_fib_set_max(struct net *net, enum nsim_resource_id res_id, u64 val, struct netlink_ext_ack *extack); -#else -static inline int nsim_devlink_setup(struct netdevsim *ns) -{ - return 0; -} - -static inline void nsim_devlink_teardown(struct netdevsim *ns) -{ -} - -static inline int nsim_devlink_init(void) -{ - return 0; -} - -static inline void nsim_devlink_exit(void) -{ -} -#endif #if IS_ENABLED(CONFIG_XFRM_OFFLOAD) void nsim_ipsec_init(struct netdevsim *ns); -- 2.17.2