History

Merge tag 'kbuild-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild updates from Masahiro Yamada: - remove headers_{install,check}_all targets - remove unreasonable 'depends on !UML' from CONFIG_SAMPLES - re-implement 'make headers_install' more cleanly - add new header-test-y syntax to compile-test headers - compile-test exported headers to ensure they are compilable in user-space - compile-test headers under include/ to ensure they are self-contained - remove -Waggregate-return, -Wno-uninitialized, -Wno-unused-value flags - add -Werror=unknown-warning-option for Clang - add 128-bit built-in types support to genksyms - fix missed rebuild of modules.builtin - propagate 'No space left on device' error in fixdep to Make - allow Clang to use its integrated assembler - improve some coccinelle scripts - add a new flag KBUILD_ABS_SRCTREE to request Kbuild to use absolute path for $(srctree). - do not ignore errors when compression utility is missing - misc cleanups * tag 'kbuild-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (49 commits) kbuild: use -- separater intead of $(filter-out ...) for cc-cross-prefix kbuild: Inform user to pass ARCH= for make mrproper kbuild: fix compression errors getting ignored kbuild: add a flag to force absolute path for srctree kbuild: replace KBUILD_SRCTREE with boolean building_out_of_srctree kbuild: remove src and obj from the top Makefile scripts/tags.sh: remove unused environment variables from comments scripts/tags.sh: drop SUBARCH support for ARM kbuild: compile-test kernel headers to ensure they are self-contained kheaders: include only headers into kheaders_data.tar.xz kheaders: remove meaningless -R option of 'ls' kbuild: support header-test-pattern-y kbuild: do not create wrappers for header-test-y kbuild: compile-test exported headers to ensure they are self-contained init/Kconfig: add CONFIG_CC_CAN_LINK kallsyms: exclude kasan local symbols on s390 kbuild: add more hints about SUBDIRS replacement coccinelle: api/stream_open: treat all wait_.*() calls as blocking coccinelle: put_device: Add a cast to an expression for an assignment coccinelle: put_device: Adjust a message construction ...

Linus Torvalds committed 7 years ago

Commit 39ceda52 parents 5f26f11 d4a74bb53 files · +1805 −458Browse files

Showing the changes to scripts (21 of 53 files). Show all

Unified · Split

21 files
  1. scripts/Kbuild.include +11 −17
  2. scripts/Makefile +0 −5
  3. scripts/Makefile.build +10 −1
  4. scripts/Makefile.extrawarn +0 −3
  5. scripts/Makefile.headersinst +57 −77
  6. scripts/Makefile.host +1 −1
  7. scripts/Makefile.lib +20 −6
  8. scripts/Makefile.modbuiltin +1 −1
  9. scripts/basic/fixdep.c +41 −10
  10. scripts/coccinelle/api/kstrdup.cocci +4 −4
  11. scripts/coccinelle/api/stream_open.cocci +4 −4
  12. scripts/coccinelle/free/put_device.cocci +5 −6
  13. scripts/gdb/linux/Makefile +1 −1
  14. scripts/genksyms/keywords.c +4 −0
  15. scripts/genksyms/parse.y +2 −0
  16. scripts/headers.sh +0 −29
  17. scripts/headers_install.sh +20 −28
  18. scripts/kallsyms.c +3 −0
  19. scripts/package/builddeb +1 −1
  20. scripts/package/mkspec +1 −1
  21. scripts/tags.sh +5 −38
scripts/Kbuild.include+11−17
@@ -79,8 +79,8 @@ endef · 78 unmodified lines
79# would try to directly execute the shell builtin 'command'. This workaround79# would try to directly execute the shell builtin 'command'. This workaround
80# should be kept for a long time since this issue was fixed only after the80# should be kept for a long time since this issue was fixed only after the
81# GNU Make 4.2.1 release.81# GNU Make 4.2.1 release.
82cc-cross-prefix = $(firstword $(foreach c, $(filter-out -%, $(1)), \82cc-cross-prefix = $(firstword $(foreach c, $(1), \
83 $(if $(shell command -v $(c)gcc 2>/dev/null), $(c))))83 $(if $(shell command -v -- $(c)gcc 2>/dev/null), $(c))))
84 84
85# output directory for tests below85# output directory for tests below
86TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)86TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)
@@ -187,12 +187,6 @@ dtbinst := -f $(srctree)/scripts/Makefile.dtbinst obj · 100 unmodified lines
187# $(Q)$(MAKE) $(clean)=dir187# $(Q)$(MAKE) $(clean)=dir
188clean := -f $(srctree)/scripts/Makefile.clean obj188clean := -f $(srctree)/scripts/Makefile.clean obj
189 189
190###
191# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.headersinst obj=
192# Usage:
193# $(Q)$(MAKE) $(hdr-inst)=dir
194hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj
195
196# echo command.190# echo command.
197# Short version is used, if $(quiet) equals `quiet_', otherwise full one.191# Short version is used, if $(quiet) equals `quiet_', otherwise full one.
198echo-cmd = $(if $($(quiet)cmd_$(1)),\192echo-cmd = $(if $($(quiet)cmd_$(1)),\
@@ -213,12 +207,12 @@ objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o))) · 14 unmodified lines
213# See Documentation/kbuild/makefiles.rst for more info207# See Documentation/kbuild/makefiles.rst for more info
214 208
215ifneq ($(KBUILD_NOCMDDEP),1)209ifneq ($(KBUILD_NOCMDDEP),1)
216# Check if both arguments are the same including their order. Result is empty210# Check if both commands are the same including their order. Result is empty
217# string if equal. User may override this check using make KBUILD_NOCMDDEP=1211# string if equal. User may override this check using make KBUILD_NOCMDDEP=1
218arg-check = $(filter-out $(subst $(space),$(space_escape),$(strip $(cmd_$@))), \212cmd-check = $(filter-out $(subst $(space),$(space_escape),$(strip $(cmd_$@))), \
219 $(subst $(space),$(space_escape),$(strip $(cmd_$1))))213 $(subst $(space),$(space_escape),$(strip $(cmd_$1))))
220else214else
221arg-check = $(if $(strip $(cmd_$@)),,1)215cmd-check = $(if $(strip $(cmd_$@)),,1)
222endif216endif
223 217
224# Replace >$< with >$$< to preserve $ when reloading the .cmd file218# Replace >$< with >$$< to preserve $ when reloading the .cmd file
@@ -231,15 +225,15 @@ make-cmd = $(call escsq,$(subst $(pound),$$(pound),$(subst $$,$$$$,$(cmd_$(1)))) · 6 unmodified lines
231 225
232# Find any prerequisites that is newer than target or that does not exist.226# Find any prerequisites that is newer than target or that does not exist.
233# PHONY targets skipped in both cases.227# PHONY targets skipped in both cases.
234any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)228any-prereq = $(filter-out $(PHONY),$?)$(filter-out $(PHONY) $(wildcard $^),$^)
235 229
236# Execute command if command has changed or prerequisite(s) are updated.230# Execute command if command has changed or prerequisite(s) are updated.
237if_changed = $(if $(strip $(any-prereq) $(arg-check)), \231if_changed = $(if $(any-prereq)$(cmd-check), \
238 $(cmd); \232 $(cmd); \
239 printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:)233 printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:)
240 234
241# Execute the command and also postprocess generated .d dependencies file.235# Execute the command and also postprocess generated .d dependencies file.
242if_changed_dep = $(if $(strip $(any-prereq) $(arg-check)),$(cmd_and_fixdep),@:)236if_changed_dep = $(if $(any-prereq)$(cmd-check),$(cmd_and_fixdep),@:)
243 237
244cmd_and_fixdep = \238cmd_and_fixdep = \
245 $(cmd); \239 $(cmd); \
@@ -249,7 +243,7 @@ cmd_and_fixdep = \ · 3 unmodified lines
249# Usage: $(call if_changed_rule,foo)243# Usage: $(call if_changed_rule,foo)
250# Will check if $(cmd_foo) or any of the prerequisites changed,244# Will check if $(cmd_foo) or any of the prerequisites changed,
251# and if so will execute $(rule_foo).245# and if so will execute $(rule_foo).
252if_changed_rule = $(if $(strip $(any-prereq) $(arg-check)),$(rule_$(1)),@:)246if_changed_rule = $(if $(any-prereq)$(cmd-check),$(rule_$(1)),@:)
253 247
254###248###
255# why - tell why a target got built249# why - tell why a target got built
@@ -274,8 +268,8 @@ ifeq ($(KBUILD_VERBOSE),2) · 18 unmodified lines
274why = \268why = \
275 $(if $(filter $@, $(PHONY)),- due to target is PHONY, \269 $(if $(filter $@, $(PHONY)),- due to target is PHONY, \
276 $(if $(wildcard $@), \270 $(if $(wildcard $@), \
277 $(if $(strip $(any-prereq)),- due to: $(any-prereq), \271 $(if $(any-prereq),- due to: $(any-prereq), \
278 $(if $(arg-check), \272 $(if $(cmd-check), \
279 $(if $(cmd_$@),- due to command line change, \273 $(if $(cmd_$@),- due to command line change, \
280 $(if $(filter $@, $(targets)), \274 $(if $(filter $@, $(targets)), \
281 - due to missing .cmd file, \275 - due to missing .cmd file, \
scripts/Makefile+0−5
@@ -31,11 +31,6 @@ always := $(hostprogs-y) $(hostprogs-m) · 30 unmodified lines
31# The following hostprogs-y programs are only build on demand31# The following hostprogs-y programs are only build on demand
32hostprogs-y += unifdef32hostprogs-y += unifdef
33 33
34# These targets are used internally to avoid "is up to date" messages
35PHONY += build_unifdef
36build_unifdef: $(obj)/unifdef
37 @:
38
39subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins34subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins
40subdir-$(CONFIG_MODVERSIONS) += genksyms35subdir-$(CONFIG_MODVERSIONS) += genksyms
41subdir-$(CONFIG_SECURITY_SELINUX) += selinux36subdir-$(CONFIG_SECURITY_SELINUX) += selinux
scripts/Makefile.build+10−1
@@ -294,6 +294,15 @@ quiet_cmd_cc_lst_c = MKLST $@ · 293 unmodified lines
294$(obj)/%.lst: $(src)/%.c FORCE294$(obj)/%.lst: $(src)/%.c FORCE
295 $(call if_changed_dep,cc_lst_c)295 $(call if_changed_dep,cc_lst_c)
296 296
297# header test (header-test-y target)
298# ---------------------------------------------------------------------------
299
300quiet_cmd_cc_s_h = CC $@
301 cmd_cc_s_h = $(CC) $(c_flags) -S -o $@ -x c /dev/null -include $<
302
303$(obj)/%.h.s: $(src)/%.h FORCE
304 $(call if_changed_dep,cc_s_h)
305
297# Compile assembler sources (.S)306# Compile assembler sources (.S)
298# ---------------------------------------------------------------------------307# ---------------------------------------------------------------------------
299 308
@@ -504,7 +513,7 @@ existing-targets := $(wildcard $(sort $(targets))) · 204 unmodified lines
504 513
505-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)514-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
506 515
507ifneq ($(srctree),.)516ifdef building_out_of_srctree
508# Create directories for object files if they do not exist517# Create directories for object files if they do not exist
509obj-dirs := $(sort $(obj) $(patsubst %/,%, $(dir $(targets))))518obj-dirs := $(sort $(obj) $(patsubst %/,%, $(dir $(targets))))
510# If targets exist, their directories apparently exist. Skip mkdir.519# If targets exist, their directories apparently exist. Skip mkdir.
scripts/Makefile.extrawarn+0−3
@@ -34,7 +34,6 @@ warning-1 += $(call cc-option, -Wstringop-truncation) · 33 unmodified lines
34warning-1 += -Wno-missing-field-initializers34warning-1 += -Wno-missing-field-initializers
35warning-1 += -Wno-sign-compare35warning-1 += -Wno-sign-compare
36 36
37warning-2 := -Waggregate-return
38warning-2 += -Wcast-align37warning-2 += -Wcast-align
39warning-2 += -Wdisabled-optimization38warning-2 += -Wdisabled-optimization
40warning-2 += -Wnested-externs39warning-2 += -Wnested-externs
@@ -68,10 +67,8 @@ else · 27 unmodified lines
68 67
69ifdef CONFIG_CC_IS_CLANG68ifdef CONFIG_CC_IS_CLANG
70KBUILD_CFLAGS += -Wno-initializer-overrides69KBUILD_CFLAGS += -Wno-initializer-overrides
71KBUILD_CFLAGS += -Wno-unused-value
72KBUILD_CFLAGS += -Wno-format70KBUILD_CFLAGS += -Wno-format
73KBUILD_CFLAGS += -Wno-sign-compare71KBUILD_CFLAGS += -Wno-sign-compare
74KBUILD_CFLAGS += -Wno-format-zero-length72KBUILD_CFLAGS += -Wno-format-zero-length
75KBUILD_CFLAGS += -Wno-uninitialized
76endif73endif
77endif74endif
scripts/Makefile.headersinst+57−77
@@ -14,109 +14,89 @@ __headers: · 13 unmodified lines
14 14
15include scripts/Kbuild.include15include scripts/Kbuild.include
16 16
17srcdir := $(srctree)/$(obj)17src := $(srctree)/$(obj)
18gen := $(objtree)/$(subst include/,include/generated/,$(obj))
19dst := usr/include
18 20
19# When make is run under a fakechroot environment, the function21-include $(src)/Kbuild
20# $(wildcard $(srcdir)/*/.) doesn't only return directories, but also regular
21# files. So, we are using a combination of sort/dir/wildcard which works
22# with fakechroot.
23subdirs := $(patsubst $(srcdir)/%/,%,\
24 $(filter-out $(srcdir)/,\
25 $(sort $(dir $(wildcard $(srcdir)/*/)))))
26 22
27# Recursion23# $(filter %/, ...) is a workaround for GNU Make <= 4.2.1, where
28__headers: $(subdirs)24# $(wildcard $(src)/*/) contains not only directories but also regular files.
25src-subdirs := $(patsubst $(src)/%/,%,$(filter %/, $(wildcard $(src)/*/)))
26gen-subdirs := $(patsubst $(gen)/%/,%,$(filter %/, $(wildcard $(gen)/*/)))
27all-subdirs := $(sort $(src-subdirs) $(gen-subdirs))
29 28
30PHONY += $(subdirs)29src-headers := $(if $(src-subdirs), $(shell cd $(src) && find $(src-subdirs) -name '*.h'))
31$(subdirs):30src-headers := $(filter-out $(no-export-headers), $(src-headers))
32 $(Q)$(MAKE) $(hdr-inst)=$(obj)/$@ dst=$(dst)/$@31gen-headers := $(if $(gen-subdirs), $(shell cd $(gen) && find $(gen-subdirs) -name '*.h'))
32gen-headers := $(filter-out $(no-export-headers), $(gen-headers))
33 33
34# Skip header install/check for include/uapi and arch/$(SRCARCH)/include/uapi.34# If the same header is exported from source and generated directories,
35# We have only sub-directories there.35# the former takes precedence, but this should be warned.
36skip-inst := $(if $(filter %/uapi,$(obj)),1)36duplicated := $(filter $(gen-headers), $(src-headers))
37$(if $(duplicated), $(warning duplicated header export: $(duplicated)))
37 38
38ifeq ($(skip-inst),)39gen-headers := $(filter-out $(duplicated), $(gen-headers))
39 40
40# Kbuild file is optional41# Add dst path prefix
41kbuild-file := $(srctree)/$(obj)/Kbuild42all-subdirs := $(addprefix $(dst)/, $(all-subdirs))
42-include $(kbuild-file)43src-headers := $(addprefix $(dst)/, $(src-headers))
44gen-headers := $(addprefix $(dst)/, $(gen-headers))
45all-headers := $(src-headers) $(gen-headers)
43 46
44installdir := $(INSTALL_HDR_PATH)/$(dst)47# Work out what needs to be removed
45gendir := $(objtree)/$(subst include/,include/generated/,$(obj))48old-subdirs := $(wildcard $(all-subdirs))
46header-files := $(notdir $(wildcard $(srcdir)/*.h))49old-headers := $(if $(old-subdirs),$(shell find $(old-subdirs) -name '*.h'))
47header-files := $(filter-out $(no-export-headers), $(header-files))50unwanted := $(filter-out $(all-headers), $(old-headers))
48genhdr-files := $(notdir $(wildcard $(gendir)/*.h))
49genhdr-files := $(filter-out $(header-files), $(genhdr-files))
50 51
51# files used to track state of install/check52# Create directories
52install-file := $(installdir)/.install53existing-dirs := $(sort $(dir $(old-headers)))
53check-file := $(installdir)/.check54wanted-dirs := $(sort $(dir $(all-headers)))
55new-dirs := $(filter-out $(existing-dirs), $(wanted-dirs))
56$(if $(new-dirs), $(shell mkdir -p $(new-dirs)))
54 57
55# all headers files for this dir58# Rules
56all-files := $(header-files) $(genhdr-files)
57output-files := $(addprefix $(installdir)/, $(all-files))
58 59
59# Work out what needs to be removed60ifndef HDRCHECK
60oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h))
61unwanted := $(filter-out $(all-files),$(oldheaders))
62 61
63# Prefix unwanted with full paths to $(INSTALL_HDR_PATH)62quiet_cmd_install = HDRINST $@
64unwanted-file := $(addprefix $(installdir)/, $(unwanted))63 cmd_install = $(CONFIG_SHELL) $(srctree)/scripts/headers_install.sh $< $@
65 64
66printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@))65$(src-headers): $(dst)/%.h: $(src)/%.h $(srctree)/scripts/headers_install.sh FORCE
66 $(call if_changed,install)
67 67
68quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\68$(gen-headers): $(dst)/%.h: $(gen)/%.h $(srctree)/scripts/headers_install.sh FORCE
69 file$(if $(word 2, $(all-files)),s))69 $(call if_changed,install)
70 cmd_install = \
71 $(CONFIG_SHELL) $< $(installdir) $(srcdir) $(header-files); \
72 $(CONFIG_SHELL) $< $(installdir) $(gendir) $(genhdr-files); \
73 touch $@
74 70
75quiet_cmd_remove = REMOVE $(unwanted)71quiet_cmd_remove = REMOVE $(unwanted)
76 cmd_remove = rm -f $(unwanted-file)72 cmd_remove = rm -f $(unwanted)
77
78quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files)
79# Headers list can be pretty long, xargs helps to avoid
80# the "Argument list too long" error.
81 cmd_check = for f in $(all-files); do \
82 echo "$(installdir)/$${f}"; done \
83 | xargs \
84 $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH); \
85 touch $@
86 73
87ifndef HDRCHECK74__headers: $(all-headers)
88# Rules for installing headers75ifneq ($(unwanted),)
89__headers: $(install-file)76 $(call cmd,remove)
77endif
90 @:78 @:
91 79
92targets += $(install-file)80existing-headers := $(filter $(old-headers), $(all-headers))
93$(install-file): scripts/headers_install.sh \81
94 $(addprefix $(srcdir)/,$(header-files)) \82-include $(foreach f,$(existing-headers),$(dir $(f)).$(notdir $(f)).cmd)
95 $(addprefix $(gendir)/,$(genhdr-files)) FORCE
96 $(if $(unwanted),$(call cmd,remove),)
97 $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@)))
98 $(call if_changed,install)
99 83
100else84else
101__headers: $(check-file)
102 @:
103 85
104targets += $(check-file)86quiet_cmd_check = HDRCHK $<
105$(check-file): scripts/headers_check.pl $(output-files) FORCE87 cmd_check = $(PERL) $(srctree)/scripts/headers_check.pl $(dst) $(SRCARCH) $<; touch $@
106 $(call if_changed,check)
107 88
108endif89check-files := $(addsuffix .chk, $(all-headers))
109 90
110cmd_files := $(wildcard \91$(check-files): $(dst)/%.chk : $(dst)/% $(srctree)/scripts/headers_check.pl
111 $(foreach f,$(sort $(targets)),$(dir $(f)).$(notdir $(f)).cmd))92 $(call cmd,check)
112 93
113ifneq ($(cmd_files),)94__headers: $(check-files)
114 include $(cmd_files)95 @:
115endif
116 96
117endif # skip-inst97endif
118 98
119PHONY += FORCE99PHONY += FORCE
120FORCE: ;100FORCE:
121 101
122.PHONY: $(PHONY)102.PHONY: $(PHONY)
scripts/Makefile.host+1−1
@@ -69,7 +69,7 @@ _hostcxx_flags = $(KBUILD_HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ · 68 unmodified lines
69 69
70# $(objtree)/$(obj) for including generated headers from checkin source files70# $(objtree)/$(obj) for including generated headers from checkin source files
71ifeq ($(KBUILD_EXTMOD),)71ifeq ($(KBUILD_EXTMOD),)
72ifneq ($(srctree),.)72ifdef building_out_of_srctree
73_hostc_flags += -I $(objtree)/$(obj)73_hostc_flags += -I $(objtree)/$(obj)
74_hostcxx_flags += -I $(objtree)/$(obj)74_hostcxx_flags += -I $(objtree)/$(obj)
75endif75endif
scripts/Makefile.lib+20−6
@@ -66,6 +66,20 @@ extra-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y)) · 65 unmodified lines
66extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-))66extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-))
67endif67endif
68 68
69# Test self-contained headers
70
71# Wildcard searches in $(srctree)/$(src)/, but not in $(objtree)/$(obj)/.
72# Stale generated headers are often left over, so pattern matching should
73# be avoided. Please notice $(srctree)/$(src)/ and $(objtree)/$(obj) point
74# to the same location for in-tree building. So, header-test-pattern-y should
75# be used with care.
76header-test-y += $(filter-out $(header-test-), \
77 $(patsubst $(srctree)/$(src)/%, %, \
78 $(wildcard $(addprefix $(srctree)/$(src)/, \
79 $(header-test-pattern-y)))))
80
81extra-$(CONFIG_HEADER_TEST) += $(addsuffix .s, $(header-test-y))
82
69# Add subdir path83# Add subdir path
70 84
71extra-y := $(addprefix $(obj)/,$(extra-y))85extra-y := $(addprefix $(obj)/,$(extra-y))
@@ -140,7 +154,7 @@ endif · 68 unmodified lines
140# $(srctree)/$(src) for including checkin headers from generated source files154# $(srctree)/$(src) for including checkin headers from generated source files
141# $(objtree)/$(obj) for including generated headers from checkin source files155# $(objtree)/$(obj) for including generated headers from checkin source files
142ifeq ($(KBUILD_EXTMOD),)156ifeq ($(KBUILD_EXTMOD),)
143ifneq ($(srctree),.)157ifdef building_out_of_srctree
144_c_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj)158_c_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj)
145_a_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj)159_a_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj)
146_cpp_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj)160_cpp_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj)
@@ -331,19 +345,19 @@ printf "%08x\n" $$dec_size | \ · 184 unmodified lines
331)345)
332 346
333quiet_cmd_bzip2 = BZIP2 $@347quiet_cmd_bzip2 = BZIP2 $@
334 cmd_bzip2 = { cat $(real-prereqs) | bzip2 -9 && $(size_append); } > $@348 cmd_bzip2 = { cat $(real-prereqs) | bzip2 -9; $(size_append); } > $@
335 349
336# Lzma350# Lzma
337# ---------------------------------------------------------------------------351# ---------------------------------------------------------------------------
338 352
339quiet_cmd_lzma = LZMA $@353quiet_cmd_lzma = LZMA $@
340 cmd_lzma = { cat $(real-prereqs) | lzma -9 && $(size_append); } > $@354 cmd_lzma = { cat $(real-prereqs) | lzma -9; $(size_append); } > $@
341 355
342quiet_cmd_lzo = LZO $@356quiet_cmd_lzo = LZO $@
343 cmd_lzo = { cat $(real-prereqs) | lzop -9 && $(size_append); } > $@357 cmd_lzo = { cat $(real-prereqs) | lzop -9; $(size_append); } > $@
344 358
345quiet_cmd_lz4 = LZ4 $@359quiet_cmd_lz4 = LZ4 $@
346 cmd_lz4 = { cat $(real-prereqs) | lz4c -l -c1 stdin stdout && \360 cmd_lz4 = { cat $(real-prereqs) | lz4c -l -c1 stdin stdout; \
347 $(size_append); } > $@361 $(size_append); } > $@
348 362
349# U-Boot mkimage363# U-Boot mkimage
@@ -386,7 +400,7 @@ quiet_cmd_uimage = UIMAGE $@ · 36 unmodified lines
386# big dictionary would increase the memory usage too much in the multi-call400# big dictionary would increase the memory usage too much in the multi-call
387# decompression mode. A BCJ filter isn't used either.401# decompression mode. A BCJ filter isn't used either.
388quiet_cmd_xzkern = XZKERN $@402quiet_cmd_xzkern = XZKERN $@
389 cmd_xzkern = { cat $(real-prereqs) | sh $(srctree)/scripts/xz_wrap.sh && \403 cmd_xzkern = { cat $(real-prereqs) | sh $(srctree)/scripts/xz_wrap.sh; \
390 $(size_append); } > $@404 $(size_append); } > $@
391 405
392quiet_cmd_xzmisc = XZMISC $@406quiet_cmd_xzmisc = XZMISC $@
scripts/Makefile.modbuiltin+1−1
@@ -15,7 +15,7 @@ include include/config/tristate.conf · 14 unmodified lines
15 15
16include scripts/Kbuild.include16include scripts/Kbuild.include
17 17
18ifneq ($(srctree),.)18ifdef building_out_of_srctree
19# Create output directory if not already present19# Create output directory if not already present
20_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))20_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
21endif21endif
scripts/basic/fixdep.c+41−10
@@ -99,6 +99,7 @@ · 98 unmodified lines
99#include <unistd.h>99#include <unistd.h>
100#include <fcntl.h>100#include <fcntl.h>
101#include <string.h>101#include <string.h>
102#include <stdarg.h>
102#include <stdlib.h>103#include <stdlib.h>
103#include <stdio.h>104#include <stdio.h>
104#include <ctype.h>105#include <ctype.h>
@@ -109,6 +110,36 @@ static void usage(void) · 4 unmodified lines
109 exit(1);110 exit(1);
110}111}
111 112
113/*
114 * In the intended usage of this program, the stdout is redirected to .*.cmd
115 * files. The return value of printf() and putchar() must be checked to catch
116 * any error, e.g. "No space left on device".
117 */
118static void xprintf(const char *format, ...)
119{
120 va_list ap;
121 int ret;
122
123 va_start(ap, format);
124 ret = vprintf(format, ap);
125 if (ret < 0) {
126 perror("fixdep");
127 exit(1);
128 }
129 va_end(ap);
130}
131
132static void xputchar(int c)
133{
134 int ret;
135
136 ret = putchar(c);
137 if (ret == EOF) {
138 perror("fixdep");
139 exit(1);
140 }
141}
142
112/*143/*
113 * Print out a dependency path from a symbol name144 * Print out a dependency path from a symbol name
114 */145 */
@@ -116,7 +147,7 @@ static void print_dep(const char *m, int slen, const char *dir) · 1 unmodified line
116{147{
117 int c, prev_c = '/', i;148 int c, prev_c = '/', i;
118 149
119 printf(" $(wildcard %s/", dir);150 xprintf(" $(wildcard %s/", dir);
120 for (i = 0; i < slen; i++) {151 for (i = 0; i < slen; i++) {
121 c = m[i];152 c = m[i];
122 if (c == '_')153 if (c == '_')
@@ -124,10 +155,10 @@ static void print_dep(const char *m, int slen, const char *dir) · 1 unmodified line
124 else155 else
125 c = tolower(c);156 c = tolower(c);
126 if (c != '/' || prev_c != '/')157 if (c != '/' || prev_c != '/')
127 putchar(c);158 xputchar(c);
128 prev_c = c;159 prev_c = c;
129 }160 }
130 printf(".h) \\\n");161 xprintf(".h) \\\n");
131}162}
132 163
133struct item {164struct item {
@@ -324,13 +355,13 @@ static void parse_dep_file(char *m, const char *target) · 190 unmodified lines
324 */355 */
325 if (!saw_any_target) {356 if (!saw_any_target) {
326 saw_any_target = 1;357 saw_any_target = 1;
327 printf("source_%s := %s\n\n",358 xprintf("source_%s := %s\n\n",
328 target, m);359 target, m);
329 printf("deps_%s := \\\n", target);360 xprintf("deps_%s := \\\n", target);
330 }361 }
331 is_first_dep = 0;362 is_first_dep = 0;
332 } else {363 } else {
333 printf(" %s \\\n", m);364 xprintf(" %s \\\n", m);
334 }365 }
335 366
336 buf = read_file(m);367 buf = read_file(m);
@@ -353,8 +384,8 @@ static void parse_dep_file(char *m, const char *target) · 16 unmodified lines
353 exit(1);384 exit(1);
354 }385 }
355 386
356 printf("\n%s: $(deps_%s)\n\n", target, target);387 xprintf("\n%s: $(deps_%s)\n\n", target, target);
357 printf("$(deps_%s):\n", target);388 xprintf("$(deps_%s):\n", target);
358}389}
359 390
360int main(int argc, char *argv[])391int main(int argc, char *argv[])
@@ -369,7 +400,7 @@ int main(int argc, char *argv[]) · 8 unmodified lines
369 target = argv[2];400 target = argv[2];
370 cmdline = argv[3];401 cmdline = argv[3];
371 402
372 printf("cmd_%s := %s\n\n", target, cmdline);403 xprintf("cmd_%s := %s\n\n", target, cmdline);
373 404
374 buf = read_file(depfile);405 buf = read_file(depfile);
375 parse_dep_file(buf, target);406 parse_dep_file(buf, target);
scripts/coccinelle/api/kstrdup.cocci+4−4
@@ -77,7 +77,7 @@ p1 << r1.p1; · 76 unmodified lines
77p2 << r1.p2;77p2 << r1.p2;
78@@78@@
79 79
80cocci.print_main("WARNING opportunity for kstrdep",p1)80cocci.print_main("WARNING opportunity for kstrdup",p1)
81cocci.print_secs("strcpy",p2)81cocci.print_secs("strcpy",p2)
82 82
83@script:python depends on org@83@script:python depends on org@
@@ -85,7 +85,7 @@ p1 << r2.p1; · 1 unmodified line
85p2 << r2.p2;85p2 << r2.p2;
86@@86@@
87 87
88cocci.print_main("WARNING opportunity for kstrdep",p1)88cocci.print_main("WARNING opportunity for kstrdup",p1)
89cocci.print_secs("memcpy",p2)89cocci.print_secs("memcpy",p2)
90 90
91@script:python depends on report@91@script:python depends on report@
@@ -93,7 +93,7 @@ p1 << r1.p1; · 1 unmodified line
93p2 << r1.p2;93p2 << r1.p2;
94@@94@@
95 95
96msg = "WARNING opportunity for kstrdep (strcpy on line %s)" % (p2[0].line)96msg = "WARNING opportunity for kstrdup (strcpy on line %s)" % (p2[0].line)
97coccilib.report.print_report(p1[0], msg)97coccilib.report.print_report(p1[0], msg)
98 98
99@script:python depends on report@99@script:python depends on report@
@@ -101,5 +101,5 @@ p1 << r2.p1; · 1 unmodified line
101p2 << r2.p2;101p2 << r2.p2;
102@@102@@
103 103
104msg = "WARNING opportunity for kstrdep (memcpy on line %s)" % (p2[0].line)104msg = "WARNING opportunity for kstrdup (memcpy on line %s)" % (p2[0].line)
105coccilib.report.print_report(p1[0], msg)105coccilib.report.print_report(p1[0], msg)
scripts/coccinelle/api/stream_open.cocci+4−4
@@ -35,11 +35,11 @@ type loff_t; · 34 unmodified lines
35// a function that blocks35// a function that blocks
36@ blocks @36@ blocks @
37identifier block_f;37identifier block_f;
38identifier wait_event =~ "^wait_event_.*";38identifier wait =~ "^wait_.*";
39@@39@@
40 block_f(...) {40 block_f(...) {
41 ... when exists41 ... when exists
42 wait_event(...)42 wait(...)
43 ... when exists43 ... when exists
44 }44 }
45 45
@@ -49,12 +49,12 @@ identifier wait_event =~ "^wait_event_.*"; · 3 unmodified lines
49// XXX currently reader_blocks supports only direct and 1-level indirect cases.49// XXX currently reader_blocks supports only direct and 1-level indirect cases.
50@ reader_blocks_direct @50@ reader_blocks_direct @
51identifier stream_reader.readstream;51identifier stream_reader.readstream;
52identifier wait_event =~ "^wait_event_.*";52identifier wait =~ "^wait_.*";
53@@53@@
54 readstream(...)54 readstream(...)
55 {55 {
56 ... when exists56 ... when exists
57 wait_event(...)57 wait(...)
58 ... when exists58 ... when exists
59 }59 }
60 60
scripts/coccinelle/free/put_device.cocci+5−6
@@ -24,7 +24,7 @@ if (id == NULL || ...) { ... return ...; } · 23 unmodified lines
24 when != of_dev_put(id)24 when != of_dev_put(id)
25 when != if (id) { ... put_device(&id->dev) ... }25 when != if (id) { ... put_device(&id->dev) ... }
26 when != e1 = (T)id26 when != e1 = (T)id
27 when != e1 = &id->dev27 when != e1 = (T)(&id->dev)
28 when != e1 = get_device(&id->dev)28 when != e1 = get_device(&id->dev)
29 when != e1 = (T1)platform_get_drvdata(id)29 when != e1 = (T1)platform_get_drvdata(id)
30(30(
@@ -42,11 +42,10 @@ p1 << search.p1; · 11 unmodified lines
42p2 << search.p2;42p2 << search.p2;
43@@43@@
44 44
45coccilib.report.print_report(p2[0], "ERROR: missing put_device; "45coccilib.report.print_report(p2[0],
46 + "call of_find_device_by_node on line "46 "ERROR: missing put_device; call of_find_device_by_node on line "
47 + p1[0].line47 + p1[0].line
48 + ", but without a corresponding object release "48 + ", but without a corresponding object release within this function.")
49 + "within this function.")
50 49
51@script:python depends on org@50@script:python depends on org@
52p1 << search.p1;51p1 << search.p1;
scripts/gdb/linux/Makefile+1−1
@@ -1,6 +1,6 @@
1# SPDX-License-Identifier: GPL-2.01# SPDX-License-Identifier: GPL-2.0
2 2
3ifneq ($(srctree),.)3ifdef building_out_of_srctree
4 4
5symlinks := $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/*.py))5symlinks := $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/*.py))
6 6
scripts/genksyms/keywords.c+4−0
@@ -25,6 +25,10 @@ static struct resword { · 24 unmodified lines
25 { "__volatile__", VOLATILE_KEYW },25 { "__volatile__", VOLATILE_KEYW },
26 { "__builtin_va_list", VA_LIST_KEYW },26 { "__builtin_va_list", VA_LIST_KEYW },
27 27
28 { "__int128", BUILTIN_INT_KEYW },
29 { "__int128_t", BUILTIN_INT_KEYW },
30 { "__uint128_t", BUILTIN_INT_KEYW },
31
28 // According to rth, c99 defines "_Bool", __restrict", __restrict__", "restrict". KAO32 // According to rth, c99 defines "_Bool", __restrict", __restrict__", "restrict". KAO
29 { "_Bool", BOOL_KEYW },33 { "_Bool", BOOL_KEYW },
30 { "_restrict", RESTRICT_KEYW },34 { "_restrict", RESTRICT_KEYW },
scripts/genksyms/parse.y+2−0
@@ -76,6 +76,7 @@ static void record_compound(struct string_list **keyw, · 75 unmodified lines
76%token ATTRIBUTE_KEYW76%token ATTRIBUTE_KEYW
77%token AUTO_KEYW77%token AUTO_KEYW
78%token BOOL_KEYW78%token BOOL_KEYW
79%token BUILTIN_INT_KEYW
79%token CHAR_KEYW80%token CHAR_KEYW
80%token CONST_KEYW81%token CONST_KEYW
81%token DOUBLE_KEYW82%token DOUBLE_KEYW
@@ -263,6 +264,7 @@ simple_type_specifier: · 181 unmodified lines
263 | VOID_KEYW264 | VOID_KEYW
264 | BOOL_KEYW265 | BOOL_KEYW
265 | VA_LIST_KEYW266 | VA_LIST_KEYW
267 | BUILTIN_INT_KEYW
266 | TYPE { (*$1)->tag = SYM_TYPEDEF; $$ = $1; }268 | TYPE { (*$1)->tag = SYM_TYPEDEF; $$ = $1; }
267 ;269 ;
268 270
scripts/headers.sh+0−29
@@ -1,29 +0,0 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3# Run headers_$1 command for all suitable architectures
4
5# Stop on error
6set -e
7
8do_command()
9{
10 if [ -f ${srctree}/arch/$2/include/asm/Kbuild ]; then
11 make ARCH=$2 KBUILD_HEADERS=$1 headers_$1
12 else
13 printf "Ignoring arch: %s\n" ${arch}
14 fi
15}
16
17archs=${HDR_ARCH_LIST:-$(ls ${srctree}/arch)}
18
19for arch in ${archs}; do
20 case ${arch} in
21 um) # no userspace export
22 ;;
23 *)
24 if [ -d ${srctree}/arch/${arch} ]; then
25 do_command $1 ${arch}
26 fi
27 ;;
28 esac
29done
scripts/headers_install.sh+20−28
@@ -1,47 +1,39 @@
1#!/bin/sh1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.02# SPDX-License-Identifier: GPL-2.0
3 3
4if [ $# -lt 2 ]4if [ $# -ne 2 ]
5then5then
6 echo "Usage: headers_install.sh OUTDIR SRCDIR [FILES...]"6 echo "Usage: headers_install.sh INFILE OUTFILE"
7 echo7 echo
8 echo "Prepares kernel header files for use by user space, by removing"8 echo "Prepares kernel header files for use by user space, by removing"
9 echo "all compiler.h definitions and #includes, removing any"9 echo "all compiler.h definitions and #includes, removing any"
10 echo "#ifdef __KERNEL__ sections, and putting __underscores__ around"10 echo "#ifdef __KERNEL__ sections, and putting __underscores__ around"
11 echo "asm/inline/volatile keywords."11 echo "asm/inline/volatile keywords."
12 echo12 echo
13 echo "OUTDIR: directory to write each userspace header FILE to."13 echo "INFILE: header file to operate on"
14 echo "SRCDIR: source directory where files are picked."14 echo "OUTFILE: output file which the processed header is writen to"
15 echo "FILES: list of header files to operate on."
16 15
17 exit 116 exit 1
18fi17fi
19 18
20# Grab arguments19# Grab arguments
20INFILE=$1
21OUTFILE=$2
22TMPFILE=$OUTFILE.tmp
21 23
22OUTDIR="$1"24trap 'rm -f $OUTFILE $TMPFILE' EXIT
23shift
24SRCDIR="$1"
25shift
26 25
27# Iterate through files listed on command line26sed -E -e '
27 s/([[:space:](])(__user|__force|__iomem)[[:space:]]/\1/g
28 s/__attribute_const__([[:space:]]|$)/\1/g
29 s@^#include <linux/compiler(|_types).h>@@
30 s/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g
31 s/(^|[[:space:](])(inline|asm|volatile)([[:space:](]|$)/\1__\2__\3/g
32 s@#(ifndef|define|endif[[:space:]]*/[*])[[:space:]]*_UAPI@#\1 @
33' $INFILE > $TMPFILE || exit 1
28 34
29FILE=35scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ $TMPFILE > $OUTFILE
30trap 'rm -f "$OUTDIR/$FILE" "$OUTDIR/$FILE.sed"' EXIT36[ $? -gt 1 ] && exit 1
31for i in "$@"37
32do38rm -f $TMPFILE
33 FILE="$(basename "$i")"
34 sed -E \
35 -e 's/([[:space:](])(__user|__force|__iomem)[[:space:]]/\1/g' \
36 -e 's/__attribute_const__([[:space:]]|$)/\1/g' \
37 -e 's@^#include <linux/compiler(|_types).h>@@' \
38 -e 's/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g' \
39 -e 's/(^|[[:space:](])(inline|asm|volatile)([[:space:](]|$)/\1__\2__\3/g' \
40 -e 's@#(ifndef|define|endif[[:space:]]*/[*])[[:space:]]*_UAPI@#\1 @' \
41 "$SRCDIR/$i" > "$OUTDIR/$FILE.sed" || exit 1
42 scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ "$OUTDIR/$FILE.sed" \
43 > "$OUTDIR/$FILE"
44 [ $? -gt 1 ] && exit 1
45 rm -f "$OUTDIR/$FILE.sed"
46done
47trap - EXIT39trap - EXIT
scripts/kallsyms.c+3−0
@@ -150,6 +150,9 @@ static int read_symbol(FILE *in, struct sym_entry *s) · 149 unmodified lines
150 /* exclude debugging symbols */150 /* exclude debugging symbols */
151 else if (stype == 'N' || stype == 'n')151 else if (stype == 'N' || stype == 'n')
152 return -1;152 return -1;
153 /* exclude s390 kasan local symbols */
154 else if (!strncmp(sym, ".LASANPC", 8))
155 return -1;
153 156
154 /* include the type field in the symbol name, so that it gets157 /* include the type field in the symbol name, so that it gets
155 * compressed together */158 * compressed together */
scripts/package/builddeb+1−1
@@ -130,7 +130,7 @@ if is_enabled CONFIG_MODULES; then · 129 unmodified lines
130fi130fi
131 131
132if [ "$ARCH" != "um" ]; then132if [ "$ARCH" != "um" ]; then
133 $MAKE -f $srctree/Makefile headers_check133 $MAKE -f $srctree/Makefile headers
134 $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH="$libc_headers_dir/usr"134 $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH="$libc_headers_dir/usr"
135fi135fi
136 136
scripts/package/mkspec+1−1
@@ -31,7 +31,7 @@ PROVIDES="$PROVIDES kernel-$KERNELRELEASE" · 30 unmodified lines
31__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")31__KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
32EXCLUDES="$RCS_TAR_IGNORE --exclude=.tmp_versions --exclude=*vmlinux* \32EXCLUDES="$RCS_TAR_IGNORE --exclude=.tmp_versions --exclude=*vmlinux* \
33--exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \33--exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \
34--exclude=.config.old --exclude=.missing-syscalls.d"34--exclude=.config.old --exclude=.missing-syscalls.d --exclude=*.s"
35 35
36# We can label the here-doc lines for conditional output to the spec file36# We can label the here-doc lines for conditional output to the spec file
37#37#
scripts/tags.sh+5−38
@@ -6,7 +6,7 @@ · 5 unmodified lines
6# mode may be any of: tags, TAGS, cscope6# mode may be any of: tags, TAGS, cscope
7#7#
8# Uses the following environment variables:8# Uses the following environment variables:
9# ARCH, SUBARCH, SRCARCH, srctree, src, obj9# SUBARCH, SRCARCH, srctree
10 10
11if [ "$KBUILD_VERBOSE" = "1" ]; then11if [ "$KBUILD_VERBOSE" = "1" ]; then
12 set -x12 set -x
@@ -17,8 +17,7 @@ ignore="$(echo "$RCS_FIND_IGNORE" | sed 's|\\||g' )" · 4 unmodified lines
17# tags and cscope files should also ignore MODVERSION *.mod.c files17# tags and cscope files should also ignore MODVERSION *.mod.c files
18ignore="$ignore ( -name *.mod.c ) -prune -o"18ignore="$ignore ( -name *.mod.c ) -prune -o"
19 19
20# Do not use full path if we do not use O=.. builds20# Use make KBUILD_ABS_SRCTREE=1 {tags|cscope}
21# Use make O=. {tags|cscope}
22# to force full paths for a non-O= build21# to force full paths for a non-O= build
23if [ "${srctree}" = "." -o -z "${srctree}" ]; then22if [ "${srctree}" = "." -o -z "${srctree}" ]; then
24 tree=23 tree=
@@ -36,21 +35,19 @@ elif [ "${ALLSOURCE_ARCHS}" = "all" ]; then · 11 unmodified lines
36 ALLSOURCE_ARCHS=$(find ${tree}arch/ -mindepth 1 -maxdepth 1 -type d -printf '%f ')35 ALLSOURCE_ARCHS=$(find ${tree}arch/ -mindepth 1 -maxdepth 1 -type d -printf '%f ')
37fi36fi
38 37
39# find sources in arch/$ARCH38# find sources in arch/$1
40find_arch_sources()39find_arch_sources()
41{40{
42 for i in $archincludedir; do41 for i in $archincludedir; do
43 prune="$prune -wholename $i -prune -o"42 prune="$prune -wholename $i -prune -o"
44 done43 done
45 find ${tree}arch/$1 $ignore $subarchprune $prune -name "$2" \44 find ${tree}arch/$1 $ignore $prune -name "$2" -not -type l -print;
46 -not -type l -print;
47}45}
48 46
49# find sources in arch/$1/include47# find sources in arch/$1/include
50find_arch_include_sources()48find_arch_include_sources()
51{49{
52 include=$(find ${tree}arch/$1/ $subarchprune \50 include=$(find ${tree}arch/$1/ -name include -type d -print);
53 -name include -type d -print);
54 if [ -n "$include" ]; then51 if [ -n "$include" ]; then
55 archincludedir="$archincludedir $include"52 archincludedir="$archincludedir $include"
56 find $include $ignore -name "$2" -not -type l -print;53 find $include $ignore -name "$2" -not -type l -print;
@@ -306,36 +303,6 @@ if [ "${ARCH}" = "um" ]; then · 249 unmodified lines
306 else303 else
307 archinclude=${SUBARCH}304 archinclude=${SUBARCH}
308 fi305 fi
309elif [ "${SRCARCH}" = "arm" -a "${SUBARCH}" != "" ]; then
310 subarchdir=$(find ${tree}arch/$SRCARCH/ -name "mach-*" -type d -o \
311 -name "plat-*" -type d);
312 mach_suffix=$SUBARCH
313 plat_suffix=$SUBARCH
314
315 # Special cases when $plat_suffix != $mach_suffix
316 case $mach_suffix in
317 "omap1" | "omap2")
318 plat_suffix="omap"
319 ;;
320 esac
321
322 if [ ! -d ${tree}arch/$SRCARCH/mach-$mach_suffix ]; then
323 echo "Warning: arch/arm/mach-$mach_suffix/ not found." >&2
324 echo " Fix your \$SUBARCH appropriately" >&2
325 fi
326
327 for i in $subarchdir; do
328 case "$i" in
329 *"mach-"${mach_suffix})
330 ;;
331 *"plat-"${plat_suffix})
332 ;;
333 *)
334 subarchprune="$subarchprune \
335 -wholename $i -prune -o"
336 ;;
337 esac
338 done
339fi306fi
340 307
341remove_structs=308remove_structs=

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t