Skip to contentSkip to conversation

iwlwifi: remove object duplication in Makefile

PATCH In review Masahiro Yamada 2 participants 4 messages Jan 6, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iwlwifi: remove object duplication in Makefile

The objects in $(iwlwifi-objs) $(iwlwifi-y) $(iwlwifi-m) are linked to iwlwifi.ko .

This line adds $(iwlwifi-m) to iwlwifi-objs, so the objects from $(iwlwifi-m) are listed twice as the dependency of the module.

It works because Kbuild trims the duplicated objects from linking, but there is no good reason to have this line.

---

 drivers/net/wireless/intel/iwlwifi/Makefile | 2 --
 1 file changed, 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/Makefile +0 -2
index 0aae3fa4128c..a018d27a5410 100644
@@ -19,8 +19,6 @@ iwlwifi-$(CONFIG_IWLMVM) += fw/paging.o fw/smem.o fw/init.o
 iwlwifi-$(CONFIG_ACPI) += fw/acpi.o
 iwlwifi-$(CONFIG_IWLWIFI_DEBUGFS) += fw/debugfs.o
 
-iwlwifi-objs += $(iwlwifi-m)
-
 iwlwifi-$(CONFIG_IWLWIFI_DEVICE_TRACING) += iwl-devtrace.o
 
 ccflags-y += -I$(src)
Signature · 1 line
2.17.1
#1 lore raw
Quoted 5 lines · Masahiro Yamada

The objects in $(iwlwifi-objs) $(iwlwifi-y) $(iwlwifi-m) are linked to iwlwifi.ko .

This line adds $(iwlwifi-m) to iwlwifi-objs, so the objects from $(iwlwifi-m) are listed twice as the dependency of the module.

Are you sure? We have

obj-$(CONFIG_IWLWIFI) += iwlwifi.o

and then "iwlwifi-y += ...", but I was under the impression that iwlwifi.o didn't really pick up iwlwifi-m automatically, that's not something that you'd normally do, normally -m only makes sense to build a module using "obj-m", just here we do it for the mvm sub level stuff...

johannes

#2 lore raw
Quoted 12 lines · Johannes Berg
Quoted 5 lines · Masahiro Yamada

The objects in $(iwlwifi-objs) $(iwlwifi-y) $(iwlwifi-m) are linked to iwlwifi.ko .

This line adds $(iwlwifi-m) to iwlwifi-objs, so the objects from $(iwlwifi-m) are listed twice as the dependency of the module.

Are you sure? We have

obj-$(CONFIG_IWLWIFI) += iwlwifi.o

Quoted 8 lines

and then "iwlwifi-y += ...", but I was under the impression that iwlwifi.o didn't really pick up iwlwifi-m automatically, that's not something that you'd normally do, normally -m only makes sense to build a module using "obj-m", just here we do it for the mvm sub level stuff...

johannes

I made a mistake.

iwlwifi-m is automatically handled since commit
cf4f21938e13ea1533ebdcb21c46f1d998a44ee8
but cfg/*.o objects are not liked to vmlinux
under the following combination:

CONFIG_IWLWIFI=y
CONFIG_IWLDVM=m
CONFIG_IWLMVM=m

Please ignore this patch.

Perhaps, I may come back to this patch,
but I need to change scripts/Makefile.lib beforehand.

Signature · 2 lines
Best Regards
Masahiro Yamada
#3 lore raw
Quoted 8 lines · Masahiro Yamada

iwlwifi-m is automatically handled since commit
cf4f21938e13ea1533ebdcb21c46f1d998a44ee8
but cfg/*.o objects are not liked to vmlinux
under the following combination:

CONFIG_IWLWIFI=y
CONFIG_IWLDVM=m
CONFIG_IWLMVM=m

Right, that's what I thought.

Quoted 2 lines

Perhaps, I may come back to this patch,
but I need to change scripts/Makefile.lib beforehand.

It's a pretty special case, not really worth it IMHO...

johannes