Skip to content

Commit

Permalink
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/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
  • Loading branch information
torvalds committed Jan 20, 2016
2 parents 0cf0305 + 7599ea8 commit d9569f0
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 20 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,12 @@ ifeq ($(KBUILD_EXTMOD),)
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)
# ===========================================================================
Expand Down Expand Up @@ -1259,7 +1265,7 @@ help:
@echo ' firmware_install- Install all firmware to INSTALL_FW_PATH'
@echo ' (default: $$(INSTALL_MOD_PATH)/lib/firmware)'
@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 ' (requires a recent binutils and recent build (System.map))'
@echo ' dir/file.ko - Build module including final link'
Expand Down
2 changes: 0 additions & 2 deletions drivers/gpu/drm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ drm-$(CONFIG_DRM_PANEL) += drm_panel.o
drm-$(CONFIG_OF) += drm_of.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_plane_helper.o drm_dp_mst_topology.o drm_atomic_helper.o
drm_kms_helper-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/ibmasm/ibmasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void ibmasmfs_unregister(void);
void ibmasmfs_add_sp(struct service_processor *sp);

/* uart */
#ifdef CONFIG_SERIAL_8250
#if IS_ENABLED(CONFIG_SERIAL_8250)
void ibmasm_register_uart(struct service_processor *sp);
void ibmasm_unregister_uart(struct service_processor *sp);
#else
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath10k/thermal.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct ath10k_thermal {
int temperature;
};

#ifdef CONFIG_THERMAL
#if IS_REACHABLE(CONFIG_THERMAL)
int ath10k_thermal_register(struct ath10k *ar);
void ath10k_thermal_unregister(struct ath10k *ar);
void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/iio/adc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ config AD7606_IFACE_PARALLEL
ADC driver.

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
tristate "spi interface support"
Expand All @@ -34,7 +34,7 @@ config AD7606_IFACE_SPI
ADC driver.

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
tristate "Analog Devices AD7780 and similar ADCs driver"
Expand Down
7 changes: 3 additions & 4 deletions drivers/staging/iio/adc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
# Makefile for industrial I/O ADC drivers
#

ad7606-y := ad7606_core.o
ad7606-$(CONFIG_IIO_BUFFER) += ad7606_ring.o
ad7606-$(CONFIG_AD7606_IFACE_PARALLEL) += ad7606_par.o
ad7606-$(CONFIG_AD7606_IFACE_SPI) += ad7606_spi.o
ad7606-y := ad7606_core.o ad7606_ring.o
obj-$(CONFIG_AD7606_IFACE_PARALLEL) += ad7606_par.o
obj-$(CONFIG_AD7606_IFACE_SPI) += ad7606_spi.o
obj-$(CONFIG_AD7606) += ad7606.o

obj-$(CONFIG_AD7780) += ad7780.o
Expand Down
4 changes: 4 additions & 0 deletions drivers/staging/iio/adc/ad7606_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ struct iio_dev *ad7606_probe(struct device *dev, int irq,
regulator_disable(st->reg);
return ERR_PTR(ret);
}
EXPORT_SYMBOL_GPL(ad7606_probe);

int ad7606_remove(struct iio_dev *indio_dev, int irq)
{
Expand All @@ -575,6 +576,7 @@ int ad7606_remove(struct iio_dev *indio_dev, int irq)

return 0;
}
EXPORT_SYMBOL_GPL(ad7606_remove);

void ad7606_suspend(struct iio_dev *indio_dev)
{
Expand All @@ -586,6 +588,7 @@ void ad7606_suspend(struct iio_dev *indio_dev)
gpio_set_value(st->pdata->gpio_stby, 0);
}
}
EXPORT_SYMBOL_GPL(ad7606_suspend);

void ad7606_resume(struct iio_dev *indio_dev)
{
Expand All @@ -600,6 +603,7 @@ void ad7606_resume(struct iio_dev *indio_dev)
ad7606_reset(st);
}
}
EXPORT_SYMBOL_GPL(ad7606_resume);

MODULE_AUTHOR("Michael Hennerich <[email protected]>");
MODULE_DESCRIPTION("Analog Devices AD7606 ADC");
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/chipidea/otg_fsm.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
/* SSEND time before SRP */
#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_otg_fsm_work(struct ci_hdrc *ci);
Expand Down
2 changes: 1 addition & 1 deletion fs/logfs/logfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ static inline int logfs_get_sb_bdev(struct logfs_super *s,
#endif

/* dev_mtd.c */
#ifdef CONFIG_MTD
#if IS_ENABLED(CONFIG_MTD)
int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr);
#else
static inline int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr)
Expand Down
8 changes: 6 additions & 2 deletions scripts/Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,14 @@ endif
# <composite-object>-objs := <list of .o files>
# or
# <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 = \
$(filter $(addprefix $(obj)/, \
$($(subst $(obj)/,,$(@:.o=-objs))) \
$($(subst $(obj)/,,$(@:.o=-y)))), $^)
$($(subst $(obj)/,,$(@:.o=-y))) \
$($(subst $(obj)/,,$(@:.o=-m)))), $^)

quiet_cmd_link_multi-y = LD $@
cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)
Expand All @@ -390,7 +394,7 @@ $(call multi_depend, $(multi-used-y), .o, -objs -y)
$(multi-used-m): FORCE
$(call if_changed,link_multi-m)
@{ 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)

Expand Down
2 changes: 2 additions & 0 deletions scripts/Makefile.extrawarn
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ warning-1 += -Wold-style-definition
warning-1 += $(call cc-option, -Wmissing-include-dirs)
warning-1 += $(call cc-option, -Wunused-but-set-variable)
warning-1 += $(call cc-disable-warning, missing-field-initializers)
warning-1 += $(call cc-disable-warning, sign-compare)

warning-2 := -Waggregate-return
warning-2 += -Wcast-align
Expand All @@ -33,6 +34,7 @@ warning-2 += -Wnested-externs
warning-2 += -Wshadow
warning-2 += $(call cc-option, -Wlogical-op)
warning-2 += $(call cc-option, -Wmissing-field-initializers)
warning-2 += $(call cc-option, -Wsign-compare)

warning-3 := -Wbad-function-cast
warning-3 += -Wcast-qual
Expand Down
4 changes: 2 additions & 2 deletions scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ subdir-ym := $(sort $(subdir-y) $(subdir-m))

# 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-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)
single-used-m := $(sort $(filter-out $(multi-used-m),$(obj-m)))

Expand All @@ -67,7 +67,7 @@ obj-dirs := $(dir $(multi-objs) $(obj-y))

# 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-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

Expand Down
2 changes: 1 addition & 1 deletion scripts/basic/fixdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static void parse_config_file(const char *map, size_t len)
}

/* 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 sublen = strlen(sub);
Expand Down
6 changes: 4 additions & 2 deletions scripts/genksyms/genksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,15 @@ static struct string_list *read_node(FILE *f)
struct string_list node = {
.string = buffer,
.tag = SYM_NORMAL };
int c;
int c, in_string = 0;

while ((c = fgetc(f)) != EOF) {
if (c == ' ') {
if (!in_string && c == ' ') {
if (node.string == buffer)
continue;
break;
} else if (c == '"') {
in_string = !in_string;
} else if (c == '\n') {
if (node.string == buffer)
return NULL;
Expand Down

0 comments on commit d9569f0

Please sign in to comment.