Commit d9569f00 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull kbuild updates from Michal Marek:
 - Make <modname>-m in makefiles work like <modname>-y and fix the
   fallout
 - Minor genksyms fix
 - Fix race with make -j install modules_install
 - Move -Wsign-compare from make W=1 to W=2
 - Other minor fixes

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kbuild: Demote 'sign-compare' warning to W=2
  Makefile: revert "Makefile: Document ability to make file.lst and file.S" partially
  kbuild: Do not run modules_install and install in paralel
  genksyms: Handle string literals with spaces in reference files
  fixdep: constify strrcmp arguments
  ath10k: Fix build with CONFIG_THERMAL=m
  Revert "drm: Hack around CONFIG_AGP=m build failures"
  kbuild: Allow to specify composite modules with modname-m
  staging/ad7606: Actually build the interface modules
parents 0cf0305f 7599ea8b
...@@ -495,6 +495,12 @@ ifeq ($(KBUILD_EXTMOD),) ...@@ -495,6 +495,12 @@ ifeq ($(KBUILD_EXTMOD),)
endif endif
endif endif
endif endif
# install and module_install need also be processed one by one
ifneq ($(filter install,$(MAKECMDGOALS)),)
ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
mixed-targets := 1
endif
endif
ifeq ($(mixed-targets),1) ifeq ($(mixed-targets),1)
# =========================================================================== # ===========================================================================
...@@ -1259,7 +1265,7 @@ help: ...@@ -1259,7 +1265,7 @@ help:
@echo ' firmware_install- Install all firmware to INSTALL_FW_PATH' @echo ' firmware_install- Install all firmware to INSTALL_FW_PATH'
@echo ' (default: $$(INSTALL_MOD_PATH)/lib/firmware)' @echo ' (default: $$(INSTALL_MOD_PATH)/lib/firmware)'
@echo ' dir/ - Build all files in dir and below' @echo ' dir/ - Build all files in dir and below'
@echo ' dir/file.[oisS] - Build specified target only' @echo ' dir/file.[ois] - Build specified target only'
@echo ' dir/file.lst - Build specified mixed source/assembly target only' @echo ' dir/file.lst - Build specified mixed source/assembly target only'
@echo ' (requires a recent binutils and recent build (System.map))' @echo ' (requires a recent binutils and recent build (System.map))'
@echo ' dir/file.ko - Build module including final link' @echo ' dir/file.ko - Build module including final link'
......
...@@ -21,8 +21,6 @@ drm-$(CONFIG_DRM_PANEL) += drm_panel.o ...@@ -21,8 +21,6 @@ drm-$(CONFIG_DRM_PANEL) += drm_panel.o
drm-$(CONFIG_OF) += drm_of.o drm-$(CONFIG_OF) += drm_of.o
drm-$(CONFIG_AGP) += drm_agpsupport.o drm-$(CONFIG_AGP) += drm_agpsupport.o
drm-y += $(drm-m)
drm_kms_helper-y := drm_crtc_helper.o drm_dp_helper.o drm_probe_helper.o \ drm_kms_helper-y := drm_crtc_helper.o drm_dp_helper.o drm_probe_helper.o \
drm_plane_helper.o drm_dp_mst_topology.o drm_atomic_helper.o drm_plane_helper.o drm_dp_mst_topology.o drm_atomic_helper.o
drm_kms_helper-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o drm_kms_helper-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o
......
...@@ -211,7 +211,7 @@ void ibmasmfs_unregister(void); ...@@ -211,7 +211,7 @@ void ibmasmfs_unregister(void);
void ibmasmfs_add_sp(struct service_processor *sp); void ibmasmfs_add_sp(struct service_processor *sp);
/* uart */ /* uart */
#ifdef CONFIG_SERIAL_8250 #if IS_ENABLED(CONFIG_SERIAL_8250)
void ibmasm_register_uart(struct service_processor *sp); void ibmasm_register_uart(struct service_processor *sp);
void ibmasm_unregister_uart(struct service_processor *sp); void ibmasm_unregister_uart(struct service_processor *sp);
#else #else
......
...@@ -36,7 +36,7 @@ struct ath10k_thermal { ...@@ -36,7 +36,7 @@ struct ath10k_thermal {
int temperature; int temperature;
}; };
#ifdef CONFIG_THERMAL #if IS_REACHABLE(CONFIG_THERMAL)
int ath10k_thermal_register(struct ath10k *ar); int ath10k_thermal_register(struct ath10k *ar);
void ath10k_thermal_unregister(struct ath10k *ar); void ath10k_thermal_unregister(struct ath10k *ar);
void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature); void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);
......
...@@ -23,7 +23,7 @@ config AD7606_IFACE_PARALLEL ...@@ -23,7 +23,7 @@ config AD7606_IFACE_PARALLEL
ADC driver. ADC driver.
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called ad7606_iface_parallel. module will be called ad7606_parallel.
config AD7606_IFACE_SPI config AD7606_IFACE_SPI
tristate "spi interface support" tristate "spi interface support"
...@@ -34,7 +34,7 @@ config AD7606_IFACE_SPI ...@@ -34,7 +34,7 @@ config AD7606_IFACE_SPI
ADC driver. ADC driver.
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called ad7606_iface_spi. module will be called ad7606_spi.
config AD7780 config AD7780
tristate "Analog Devices AD7780 and similar ADCs driver" tristate "Analog Devices AD7780 and similar ADCs driver"
......
...@@ -2,10 +2,9 @@ ...@@ -2,10 +2,9 @@
# Makefile for industrial I/O ADC drivers # Makefile for industrial I/O ADC drivers
# #
ad7606-y := ad7606_core.o ad7606-y := ad7606_core.o ad7606_ring.o
ad7606-$(CONFIG_IIO_BUFFER) += ad7606_ring.o obj-$(CONFIG_AD7606_IFACE_PARALLEL) += ad7606_par.o
ad7606-$(CONFIG_AD7606_IFACE_PARALLEL) += ad7606_par.o obj-$(CONFIG_AD7606_IFACE_SPI) += ad7606_spi.o
ad7606-$(CONFIG_AD7606_IFACE_SPI) += ad7606_spi.o
obj-$(CONFIG_AD7606) += ad7606.o obj-$(CONFIG_AD7606) += ad7606.o
obj-$(CONFIG_AD7780) += ad7780.o obj-$(CONFIG_AD7780) += ad7780.o
......
...@@ -559,6 +559,7 @@ struct iio_dev *ad7606_probe(struct device *dev, int irq, ...@@ -559,6 +559,7 @@ struct iio_dev *ad7606_probe(struct device *dev, int irq,
regulator_disable(st->reg); regulator_disable(st->reg);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
EXPORT_SYMBOL_GPL(ad7606_probe);
int ad7606_remove(struct iio_dev *indio_dev, int irq) int ad7606_remove(struct iio_dev *indio_dev, int irq)
{ {
...@@ -575,6 +576,7 @@ int ad7606_remove(struct iio_dev *indio_dev, int irq) ...@@ -575,6 +576,7 @@ int ad7606_remove(struct iio_dev *indio_dev, int irq)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(ad7606_remove);
void ad7606_suspend(struct iio_dev *indio_dev) void ad7606_suspend(struct iio_dev *indio_dev)
{ {
...@@ -586,6 +588,7 @@ void ad7606_suspend(struct iio_dev *indio_dev) ...@@ -586,6 +588,7 @@ void ad7606_suspend(struct iio_dev *indio_dev)
gpio_set_value(st->pdata->gpio_stby, 0); gpio_set_value(st->pdata->gpio_stby, 0);
} }
} }
EXPORT_SYMBOL_GPL(ad7606_suspend);
void ad7606_resume(struct iio_dev *indio_dev) void ad7606_resume(struct iio_dev *indio_dev)
{ {
...@@ -600,6 +603,7 @@ void ad7606_resume(struct iio_dev *indio_dev) ...@@ -600,6 +603,7 @@ void ad7606_resume(struct iio_dev *indio_dev)
ad7606_reset(st); ad7606_reset(st);
} }
} }
EXPORT_SYMBOL_GPL(ad7606_resume);
MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
MODULE_DESCRIPTION("Analog Devices AD7606 ADC"); MODULE_DESCRIPTION("Analog Devices AD7606 ADC");
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
/* SSEND time before SRP */ /* SSEND time before SRP */
#define TB_SSEND_SRP (1500) /* minimum 1.5 sec, section:5.1.2 */ #define TB_SSEND_SRP (1500) /* minimum 1.5 sec, section:5.1.2 */
#ifdef CONFIG_USB_OTG_FSM #if IS_ENABLED(CONFIG_USB_OTG_FSM)
int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci); int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci);
int ci_otg_fsm_work(struct ci_hdrc *ci); int ci_otg_fsm_work(struct ci_hdrc *ci);
......
...@@ -485,7 +485,7 @@ static inline int logfs_get_sb_bdev(struct logfs_super *s, ...@@ -485,7 +485,7 @@ static inline int logfs_get_sb_bdev(struct logfs_super *s,
#endif #endif
/* dev_mtd.c */ /* dev_mtd.c */
#ifdef CONFIG_MTD #if IS_ENABLED(CONFIG_MTD)
int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr); int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr);
#else #else
static inline int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr) static inline int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr)
......
...@@ -372,10 +372,14 @@ endif ...@@ -372,10 +372,14 @@ endif
# <composite-object>-objs := <list of .o files> # <composite-object>-objs := <list of .o files>
# or # or
# <composite-object>-y := <list of .o files> # <composite-object>-y := <list of .o files>
# or
# <composite-object>-m := <list of .o files>
# The -m syntax only works if <composite object> is a module
link_multi_deps = \ link_multi_deps = \
$(filter $(addprefix $(obj)/, \ $(filter $(addprefix $(obj)/, \
$($(subst $(obj)/,,$(@:.o=-objs))) \ $($(subst $(obj)/,,$(@:.o=-objs))) \
$($(subst $(obj)/,,$(@:.o=-y)))), $^) $($(subst $(obj)/,,$(@:.o=-y))) \
$($(subst $(obj)/,,$(@:.o=-m)))), $^)
quiet_cmd_link_multi-y = LD $@ quiet_cmd_link_multi-y = LD $@
cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis) cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)
...@@ -390,7 +394,7 @@ $(call multi_depend, $(multi-used-y), .o, -objs -y) ...@@ -390,7 +394,7 @@ $(call multi_depend, $(multi-used-y), .o, -objs -y)
$(multi-used-m): FORCE $(multi-used-m): FORCE
$(call if_changed,link_multi-m) $(call if_changed,link_multi-m)
@{ echo $(@:.o=.ko); echo $(link_multi_deps); } > $(MODVERDIR)/$(@F:.o=.mod) @{ echo $(@:.o=.ko); echo $(link_multi_deps); } > $(MODVERDIR)/$(@F:.o=.mod)
$(call multi_depend, $(multi-used-m), .o, -objs -y) $(call multi_depend, $(multi-used-m), .o, -objs -y -m)
targets += $(multi-used-y) $(multi-used-m) targets += $(multi-used-y) $(multi-used-m)
......
...@@ -25,6 +25,7 @@ warning-1 += -Wold-style-definition ...@@ -25,6 +25,7 @@ warning-1 += -Wold-style-definition
warning-1 += $(call cc-option, -Wmissing-include-dirs) warning-1 += $(call cc-option, -Wmissing-include-dirs)
warning-1 += $(call cc-option, -Wunused-but-set-variable) warning-1 += $(call cc-option, -Wunused-but-set-variable)
warning-1 += $(call cc-disable-warning, missing-field-initializers) warning-1 += $(call cc-disable-warning, missing-field-initializers)
warning-1 += $(call cc-disable-warning, sign-compare)
warning-2 := -Waggregate-return warning-2 := -Waggregate-return
warning-2 += -Wcast-align warning-2 += -Wcast-align
...@@ -33,6 +34,7 @@ warning-2 += -Wnested-externs ...@@ -33,6 +34,7 @@ warning-2 += -Wnested-externs
warning-2 += -Wshadow warning-2 += -Wshadow
warning-2 += $(call cc-option, -Wlogical-op) warning-2 += $(call cc-option, -Wlogical-op)
warning-2 += $(call cc-option, -Wmissing-field-initializers) warning-2 += $(call cc-option, -Wmissing-field-initializers)
warning-2 += $(call cc-option, -Wsign-compare)
warning-3 := -Wbad-function-cast warning-3 := -Wbad-function-cast
warning-3 += -Wcast-qual warning-3 += -Wcast-qual
......
...@@ -48,7 +48,7 @@ subdir-ym := $(sort $(subdir-y) $(subdir-m)) ...@@ -48,7 +48,7 @@ subdir-ym := $(sort $(subdir-y) $(subdir-m))
# if $(foo-objs) exists, foo.o is a composite object # if $(foo-objs) exists, foo.o is a composite object
multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))), $(m))))
multi-used := $(multi-used-y) $(multi-used-m) multi-used := $(multi-used-y) $(multi-used-m)
single-used-m := $(sort $(filter-out $(multi-used-m),$(obj-m))) single-used-m := $(sort $(filter-out $(multi-used-m),$(obj-m)))
...@@ -67,7 +67,7 @@ obj-dirs := $(dir $(multi-objs) $(obj-y)) ...@@ -67,7 +67,7 @@ obj-dirs := $(dir $(multi-objs) $(obj-y))
# Replace multi-part objects by their individual parts, look at local dir only # Replace multi-part objects by their individual parts, look at local dir only
real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(extra-y) real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(extra-y)
real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m)))
# Add subdir path # Add subdir path
......
...@@ -251,7 +251,7 @@ static void parse_config_file(const char *map, size_t len) ...@@ -251,7 +251,7 @@ static void parse_config_file(const char *map, size_t len)
} }
/* test is s ends in sub */ /* test is s ends in sub */
static int strrcmp(char *s, char *sub) static int strrcmp(const char *s, const char *sub)
{ {
int slen = strlen(s); int slen = strlen(s);
int sublen = strlen(sub); int sublen = strlen(sub);
......
...@@ -423,13 +423,15 @@ static struct string_list *read_node(FILE *f) ...@@ -423,13 +423,15 @@ static struct string_list *read_node(FILE *f)
struct string_list node = { struct string_list node = {
.string = buffer, .string = buffer,
.tag = SYM_NORMAL }; .tag = SYM_NORMAL };
int c; int c, in_string = 0;
while ((c = fgetc(f)) != EOF) { while ((c = fgetc(f)) != EOF) {
if (c == ' ') { if (!in_string && c == ' ') {
if (node.string == buffer) if (node.string == buffer)
continue; continue;
break; break;
} else if (c == '"') {
in_string = !in_string;
} else if (c == '\n') { } else if (c == '\n') {
if (node.string == buffer) if (node.string == buffer)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment