linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] net: move CONFIG_NET guard to top Makefile
@ 2021-01-25 23:16 Masahiro Yamada
  2021-01-25 23:16 ` [PATCH 2/4] net: dcb: use obj-$(CONFIG_DCB) form in net/Makefile Masahiro Yamada
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Masahiro Yamada @ 2021-01-25 23:16 UTC (permalink / raw)
  To: netdev
  Cc: Masahiro Yamada, Alexei Starovoitov, Andrii Nakryiko,
	Daniel Borkmann, David S. Miller, Jakub Kicinski, John Fastabend,
	KP Singh, Martin KaFai Lau, Michal Marek, Song Liu,
	Yonghong Song, bpf, linux-kbuild, linux-kernel

When CONFIG_NET is disabled, nothing under the net/ directory is
compiled. Move the CONFIG_NET guard to the top Makefile so the net/
directory is entirely skipped.

When Kbuild visits net/Makefile, CONFIG_NET is obvioulsy 'y' because
CONFIG_NET is a bool option. Clean up net/Makefile.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 Makefile     |  3 ++-
 net/Makefile | 11 ++++-------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index b0e4767735dc..61357f7eb55f 100644
--- a/Makefile
+++ b/Makefile
@@ -649,7 +649,8 @@ ifeq ($(KBUILD_EXTMOD),)
 core-y		:= init/ usr/
 drivers-y	:= drivers/ sound/
 drivers-$(CONFIG_SAMPLES) += samples/
-drivers-y	+= net/ virt/
+drivers-$(CONFIG_NET) += net/
+drivers-y	+= virt/
 libs-y		:= lib/
 endif # KBUILD_EXTMOD
 
diff --git a/net/Makefile b/net/Makefile
index d96b0aa8f39f..6fa3b2e26cab 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -6,20 +6,19 @@
 # Rewritten to use lists instead of if-statements.
 #
 
-obj-$(CONFIG_NET)		:= devres.o socket.o core/
+obj-y				:= devres.o socket.o core/
 
-tmp-$(CONFIG_COMPAT) 		:= compat.o
-obj-$(CONFIG_NET)		+= $(tmp-y)
+obj-$(CONFIG_COMPAT)		+= compat.o
 
 # LLC has to be linked before the files in net/802/
 obj-$(CONFIG_LLC)		+= llc/
-obj-$(CONFIG_NET)		+= ethernet/ 802/ sched/ netlink/ bpf/ ethtool/
+obj-y				+= ethernet/ 802/ sched/ netlink/ bpf/ ethtool/
 obj-$(CONFIG_NETFILTER)		+= netfilter/
 obj-$(CONFIG_INET)		+= ipv4/
 obj-$(CONFIG_TLS)		+= tls/
 obj-$(CONFIG_XFRM)		+= xfrm/
 obj-$(CONFIG_UNIX_SCM)		+= unix/
-obj-$(CONFIG_NET)		+= ipv6/
+obj-y				+= ipv6/
 obj-$(CONFIG_BPFILTER)		+= bpfilter/
 obj-$(CONFIG_PACKET)		+= packet/
 obj-$(CONFIG_NET_KEY)		+= key/
@@ -63,9 +62,7 @@ obj-$(CONFIG_6LOWPAN)		+= 6lowpan/
 obj-$(CONFIG_IEEE802154)	+= ieee802154/
 obj-$(CONFIG_MAC802154)		+= mac802154/
 
-ifeq ($(CONFIG_NET),y)
 obj-$(CONFIG_SYSCTL)		+= sysctl_net.o
-endif
 obj-$(CONFIG_DNS_RESOLVER)	+= dns_resolver/
 obj-$(CONFIG_CEPH_LIB)		+= ceph/
 obj-$(CONFIG_BATMAN_ADV)	+= batman-adv/
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] net: dcb: use obj-$(CONFIG_DCB) form in net/Makefile
  2021-01-25 23:16 [PATCH 1/4] net: move CONFIG_NET guard to top Makefile Masahiro Yamada
@ 2021-01-25 23:16 ` Masahiro Yamada
  2021-01-25 23:16 ` [PATCH 3/4] net: switchdev: use obj-$(CONFIG_NET_SWITCHDEV) " Masahiro Yamada
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2021-01-25 23:16 UTC (permalink / raw)
  To: netdev; +Cc: Masahiro Yamada, David S. Miller, Jakub Kicinski, linux-kernel

CONFIG_DCB is a bool option. Change the ifeq conditional to the
standard obj-$(CONFIG_DCB) form.

Use obj-y in net/dcb/Makefile because Kbuild visits this Makefile
only when CONFIG_DCB=y.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 net/Makefile     | 4 +---
 net/dcb/Makefile | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/Makefile b/net/Makefile
index 6fa3b2e26cab..a7e38bd463a4 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -55,9 +55,7 @@ obj-$(CONFIG_SMC)		+= smc/
 obj-$(CONFIG_RFKILL)		+= rfkill/
 obj-$(CONFIG_NET_9P)		+= 9p/
 obj-$(CONFIG_CAIF)		+= caif/
-ifneq ($(CONFIG_DCB),)
-obj-y				+= dcb/
-endif
+obj-$(CONFIG_DCB)		+= dcb/
 obj-$(CONFIG_6LOWPAN)		+= 6lowpan/
 obj-$(CONFIG_IEEE802154)	+= ieee802154/
 obj-$(CONFIG_MAC802154)		+= mac802154/
diff --git a/net/dcb/Makefile b/net/dcb/Makefile
index 3016e5a7716a..2c0fa16ee2a9 100644
--- a/net/dcb/Makefile
+++ b/net/dcb/Makefile
@@ -1,2 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_DCB) += dcbnl.o dcbevent.o
+obj-y += dcbnl.o dcbevent.o
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] net: switchdev: use obj-$(CONFIG_NET_SWITCHDEV) form in net/Makefile
  2021-01-25 23:16 [PATCH 1/4] net: move CONFIG_NET guard to top Makefile Masahiro Yamada
  2021-01-25 23:16 ` [PATCH 2/4] net: dcb: use obj-$(CONFIG_DCB) form in net/Makefile Masahiro Yamada
@ 2021-01-25 23:16 ` Masahiro Yamada
  2021-01-25 23:16 ` [PATCH 4/4] net: l3mdev: use obj-$(CONFIG_NET_L3_MASTER_DEV) " Masahiro Yamada
  2021-01-28  1:10 ` [PATCH 1/4] net: move CONFIG_NET guard to top Makefile patchwork-bot+netdevbpf
  3 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2021-01-25 23:16 UTC (permalink / raw)
  To: netdev
  Cc: Masahiro Yamada, David S. Miller, Ivan Vecera, Jakub Kicinski,
	Jiri Pirko, linux-kernel

CONFIG_NET_SWITCHDEV is a bool option. Change the ifeq conditional to
the standard obj-$(CONFIG_NET_SWITCHDEV) form.

Use obj-y in net/switchdev/Makefile because Kbuild visits this Makefile
only when CONFIG_NET_SWITCHDEV=y.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 net/Makefile           | 4 +---
 net/switchdev/Makefile | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/Makefile b/net/Makefile
index a7e38bd463a4..a18547c97cbb 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -72,9 +72,7 @@ obj-$(CONFIG_VSOCKETS)	+= vmw_vsock/
 obj-$(CONFIG_MPLS)		+= mpls/
 obj-$(CONFIG_NET_NSH)		+= nsh/
 obj-$(CONFIG_HSR)		+= hsr/
-ifneq ($(CONFIG_NET_SWITCHDEV),)
-obj-y				+= switchdev/
-endif
+obj-$(CONFIG_NET_SWITCHDEV)	+= switchdev/
 ifneq ($(CONFIG_NET_L3_MASTER_DEV),)
 obj-y				+= l3mdev/
 endif
diff --git a/net/switchdev/Makefile b/net/switchdev/Makefile
index bd69a3136e76..c5561d7f3a7c 100644
--- a/net/switchdev/Makefile
+++ b/net/switchdev/Makefile
@@ -3,4 +3,4 @@
 # Makefile for the Switch device API
 #
 
-obj-$(CONFIG_NET_SWITCHDEV) += switchdev.o
+obj-y += switchdev.o
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] net: l3mdev: use obj-$(CONFIG_NET_L3_MASTER_DEV) form in net/Makefile
  2021-01-25 23:16 [PATCH 1/4] net: move CONFIG_NET guard to top Makefile Masahiro Yamada
  2021-01-25 23:16 ` [PATCH 2/4] net: dcb: use obj-$(CONFIG_DCB) form in net/Makefile Masahiro Yamada
  2021-01-25 23:16 ` [PATCH 3/4] net: switchdev: use obj-$(CONFIG_NET_SWITCHDEV) " Masahiro Yamada
@ 2021-01-25 23:16 ` Masahiro Yamada
  2021-01-26  3:44   ` David Ahern
  2021-01-28  1:10 ` [PATCH 1/4] net: move CONFIG_NET guard to top Makefile patchwork-bot+netdevbpf
  3 siblings, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2021-01-25 23:16 UTC (permalink / raw)
  To: netdev
  Cc: Masahiro Yamada, David Ahern, David S. Miller, Jakub Kicinski,
	linux-kernel

CONFIG_NET_L3_MASTER_DEV is a bool option. Change the ifeq conditional
to the standard obj-$(CONFIG_NET_L3_MASTER_DEV) form.

Use obj-y in net/l3mdev/Makefile because Kbuild visits this Makefile
only when CONFIG_NET_L3_MASTER_DEV=y.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 net/Makefile        | 4 +---
 net/l3mdev/Makefile | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/Makefile b/net/Makefile
index a18547c97cbb..9ca9572188fe 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -73,9 +73,7 @@ obj-$(CONFIG_MPLS)		+= mpls/
 obj-$(CONFIG_NET_NSH)		+= nsh/
 obj-$(CONFIG_HSR)		+= hsr/
 obj-$(CONFIG_NET_SWITCHDEV)	+= switchdev/
-ifneq ($(CONFIG_NET_L3_MASTER_DEV),)
-obj-y				+= l3mdev/
-endif
+obj-$(CONFIG_NET_L3_MASTER_DEV)	+= l3mdev/
 obj-$(CONFIG_QRTR)		+= qrtr/
 obj-$(CONFIG_NET_NCSI)		+= ncsi/
 obj-$(CONFIG_XDP_SOCKETS)	+= xdp/
diff --git a/net/l3mdev/Makefile b/net/l3mdev/Makefile
index 59755a9e2f9b..9e7da0acc58c 100644
--- a/net/l3mdev/Makefile
+++ b/net/l3mdev/Makefile
@@ -3,4 +3,4 @@
 # Makefile for the L3 device API
 #
 
-obj-$(CONFIG_NET_L3_MASTER_DEV) += l3mdev.o
+obj-y += l3mdev.o
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 4/4] net: l3mdev: use obj-$(CONFIG_NET_L3_MASTER_DEV) form in net/Makefile
  2021-01-25 23:16 ` [PATCH 4/4] net: l3mdev: use obj-$(CONFIG_NET_L3_MASTER_DEV) " Masahiro Yamada
@ 2021-01-26  3:44   ` David Ahern
  0 siblings, 0 replies; 6+ messages in thread
From: David Ahern @ 2021-01-26  3:44 UTC (permalink / raw)
  To: Masahiro Yamada, netdev
  Cc: David Ahern, David S. Miller, Jakub Kicinski, linux-kernel

On 1/25/21 4:16 PM, Masahiro Yamada wrote:
> CONFIG_NET_L3_MASTER_DEV is a bool option. Change the ifeq conditional
> to the standard obj-$(CONFIG_NET_L3_MASTER_DEV) form.
> 
> Use obj-y in net/l3mdev/Makefile because Kbuild visits this Makefile
> only when CONFIG_NET_L3_MASTER_DEV=y.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  net/Makefile        | 4 +---
>  net/l3mdev/Makefile | 2 +-
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/4] net: move CONFIG_NET guard to top Makefile
  2021-01-25 23:16 [PATCH 1/4] net: move CONFIG_NET guard to top Makefile Masahiro Yamada
                   ` (2 preceding siblings ...)
  2021-01-25 23:16 ` [PATCH 4/4] net: l3mdev: use obj-$(CONFIG_NET_L3_MASTER_DEV) " Masahiro Yamada
@ 2021-01-28  1:10 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-01-28  1:10 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: netdev, ast, andrii, daniel, davem, kuba, john.fastabend,
	kpsingh, kafai, michal.lkml, songliubraving, yhs, bpf,
	linux-kbuild, linux-kernel

Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Tue, 26 Jan 2021 08:16:55 +0900 you wrote:
> When CONFIG_NET is disabled, nothing under the net/ directory is
> compiled. Move the CONFIG_NET guard to the top Makefile so the net/
> directory is entirely skipped.
> 
> When Kbuild visits net/Makefile, CONFIG_NET is obvioulsy 'y' because
> CONFIG_NET is a bool option. Clean up net/Makefile.
> 
> [...]

Here is the summary with links:
  - [1/4] net: move CONFIG_NET guard to top Makefile
    https://git.kernel.org/netdev/net-next/c/8b5f4eb3ab70
  - [2/4] net: dcb: use obj-$(CONFIG_DCB) form in net/Makefile
    https://git.kernel.org/netdev/net-next/c/1e328ed55920
  - [3/4] net: switchdev: use obj-$(CONFIG_NET_SWITCHDEV) form in net/Makefile
    https://git.kernel.org/netdev/net-next/c/0cfd99b487f1
  - [4/4] net: l3mdev: use obj-$(CONFIG_NET_L3_MASTER_DEV) form in net/Makefile
    https://git.kernel.org/netdev/net-next/c/d32f834cd687

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-28  1:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 23:16 [PATCH 1/4] net: move CONFIG_NET guard to top Makefile Masahiro Yamada
2021-01-25 23:16 ` [PATCH 2/4] net: dcb: use obj-$(CONFIG_DCB) form in net/Makefile Masahiro Yamada
2021-01-25 23:16 ` [PATCH 3/4] net: switchdev: use obj-$(CONFIG_NET_SWITCHDEV) " Masahiro Yamada
2021-01-25 23:16 ` [PATCH 4/4] net: l3mdev: use obj-$(CONFIG_NET_L3_MASTER_DEV) " Masahiro Yamada
2021-01-26  3:44   ` David Ahern
2021-01-28  1:10 ` [PATCH 1/4] net: move CONFIG_NET guard to top Makefile patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).