Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kbuild: replace $(if A,A,B) with $(or A,B)

$(or ...) is available since GNU Make 3.81, and useful to shorten the
code in some places.

Covert as follows:

$(if A,A,B) --> $(or A,B)

This patch also converts:

$(if A, A, B) --> $(or A, B)

Strictly speaking, the latter is not an equivalent conversion because
GNU Make keeps spaces after commas; if A is not empty, $(if A, A, B)
expands to " A", while $(or A, B) expands to "A".

Anyway, preceding spaces are not significant in the code hunks I touched.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>

+30 -31
+4 -4
Makefile
··· 1240 1240 echo \#define LINUX_VERSION_SUBLEVEL $(SUBLEVEL) 1241 1241 endef 1242 1242 1243 - $(version_h): PATCHLEVEL := $(if $(PATCHLEVEL), $(PATCHLEVEL), 0) 1244 - $(version_h): SUBLEVEL := $(if $(SUBLEVEL), $(SUBLEVEL), 0) 1243 + $(version_h): PATCHLEVEL := $(or $(PATCHLEVEL), 0) 1244 + $(version_h): SUBLEVEL := $(or $(SUBLEVEL), 0) 1245 1245 $(version_h): FORCE 1246 1246 $(call filechk,version.h) 1247 1247 ··· 1624 1624 @$(MAKE) -f $(srctree)/Documentation/Makefile dochelp 1625 1625 @echo '' 1626 1626 @echo 'Architecture specific targets ($(SRCARCH)):' 1627 - @$(if $(archhelp),$(archhelp),\ 1627 + @$(or $(archhelp),\ 1628 1628 echo ' No architecture specific help defined for $(SRCARCH)') 1629 1629 @echo '' 1630 1630 @$(if $(boards), \ ··· 1841 1841 1842 1842 clean: $(clean-dirs) 1843 1843 $(call cmd,rmfiles) 1844 - @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ 1844 + @find $(or $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ 1845 1845 \( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \ 1846 1846 -o -name '*.ko.*' \ 1847 1847 -o -name '*.dtb' -o -name '*.dtbo' -o -name '*.dtb.S' -o -name '*.dt.yaml' \
+1 -2
scripts/Makefile.build
··· 40 40 41 41 # The filename Kbuild has precedence over Makefile 42 42 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 43 - kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile) 44 - include $(kbuild-file) 43 + include $(or $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Makefile) 45 44 46 45 include $(srctree)/scripts/Makefile.lib 47 46
+1 -1
scripts/Makefile.clean
··· 12 12 13 13 # The filename Kbuild has precedence over Makefile 14 14 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 15 - include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) 15 + include $(or $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Makefile) 16 16 17 17 # Figure out what we need to build from the various variables 18 18 # ==========================================================================
+2 -2
scripts/Makefile.lib
··· 111 111 modname-multi = $(sort $(foreach m,$(multi-obj-ym),\ 112 112 $(if $(filter $*.o, $(call suffix-search, $m, .o, -objs -y -m)),$(m:.o=)))) 113 113 114 - __modname = $(if $(modname-multi),$(modname-multi),$(basetarget)) 114 + __modname = $(or $(modname-multi),$(basetarget)) 115 115 116 116 modname = $(subst $(space),:,$(__modname)) 117 117 modfile = $(addprefix $(obj)/,$(__modname)) ··· 434 434 # SRCARCH just happens to match slightly more than ARCH (on sparc), so reduces 435 435 # the number of overrides in arch makefiles 436 436 UIMAGE_ARCH ?= $(SRCARCH) 437 - UIMAGE_COMPRESSION ?= $(if $(2),$(2),none) 437 + UIMAGE_COMPRESSION ?= $(or $(2),none) 438 438 UIMAGE_OPTS-y ?= 439 439 UIMAGE_TYPE ?= kernel 440 440 UIMAGE_LOADADDR ?= arch_must_set_this
+2 -2
tools/bpf/bpftool/Makefile
··· 78 78 CFLAGS += -W -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers 79 79 CFLAGS += $(filter-out -Wswitch-enum -Wnested-externs,$(EXTRA_WARNINGS)) 80 80 CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \ 81 - -I$(if $(OUTPUT),$(OUTPUT),.) \ 81 + -I$(or $(OUTPUT),.) \ 82 82 -I$(LIBBPF_INCLUDE) \ 83 83 -I$(srctree)/kernel/bpf/ \ 84 84 -I$(srctree)/tools/include \ ··· 186 186 187 187 $(OUTPUT)%.bpf.o: skeleton/%.bpf.c $(OUTPUT)vmlinux.h $(LIBBPF_BOOTSTRAP) 188 188 $(QUIET_CLANG)$(CLANG) \ 189 - -I$(if $(OUTPUT),$(OUTPUT),.) \ 189 + -I$(or $(OUTPUT),.) \ 190 190 -I$(srctree)/tools/include/uapi/ \ 191 191 -I$(LIBBPF_BOOTSTRAP_INCLUDE) \ 192 192 -g -O2 -Wall -target bpf -c $< -o $@
+1 -1
tools/build/Makefile
··· 36 36 37 37 clean: 38 38 $(call QUIET_CLEAN, fixdep) 39 - $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete 39 + $(Q)find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete 40 40 $(Q)rm -f $(OUTPUT)fixdep 41 41 $(call QUIET_CLEAN, feature-detect) 42 42 ifneq ($(wildcard $(TMP_O)),)
+1 -1
tools/counter/Makefile
··· 40 40 clean: 41 41 rm -f $(ALL_PROGRAMS) 42 42 rm -rf $(OUTPUT)include/linux/counter.h 43 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 43 + find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 44 44 45 45 install: $(ALL_PROGRAMS) 46 46 install -d -m 755 $(DESTDIR)$(bindir); \
+1 -1
tools/gpio/Makefile
··· 78 78 clean: 79 79 rm -f $(ALL_PROGRAMS) 80 80 rm -f $(OUTPUT)include/linux/gpio.h 81 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 81 + find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 82 82 83 83 install: $(ALL_PROGRAMS) 84 84 install -d -m 755 $(DESTDIR)$(bindir); \
+1 -1
tools/hv/Makefile
··· 47 47 48 48 clean: 49 49 rm -f $(ALL_PROGRAMS) 50 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 50 + find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 51 51 52 52 install: $(ALL_PROGRAMS) 53 53 install -d -m 755 $(DESTDIR)$(sbindir); \
+1 -1
tools/iio/Makefile
··· 58 58 clean: 59 59 rm -f $(ALL_PROGRAMS) 60 60 rm -rf $(OUTPUT)include/linux/iio 61 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 61 + find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 62 62 63 63 install: $(ALL_PROGRAMS) 64 64 install -d -m 755 $(DESTDIR)$(bindir); \
+1 -1
tools/lib/api/Makefile
··· 60 60 61 61 clean: 62 62 $(call QUIET_CLEAN, libapi) $(RM) $(LIBFILE); \ 63 - find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM) 63 + find $(or $(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM) 64 64 65 65 FORCE: 66 66
+1 -1
tools/lib/bpf/Makefile
··· 60 60 VERBOSE = 0 61 61 endif 62 62 63 - INCLUDES = -I$(if $(OUTPUT),$(OUTPUT),.) \ 63 + INCLUDES = -I$(or $(OUTPUT),.) \ 64 64 -I$(srctree)/tools/include -I$(srctree)/tools/include/uapi 65 65 66 66 export prefix libdir src obj
+1 -1
tools/lib/perf/Makefile
··· 153 153 $(QUIET_LINK)$(CC) -o $@ $^ 154 154 155 155 $(TESTS_SHARED): $(TESTS_IN) $(LIBAPI) 156 - $(QUIET_LINK)$(CC) -o $@ -L$(if $(OUTPUT),$(OUTPUT),.) $^ -lperf 156 + $(QUIET_LINK)$(CC) -o $@ -L$(or $(OUTPUT),.) $^ -lperf 157 157 158 158 make-tests: libs $(TESTS_SHARED) $(TESTS_STATIC) 159 159
+1 -1
tools/lib/subcmd/Makefile
··· 63 63 64 64 clean: 65 65 $(call QUIET_CLEAN, libsubcmd) $(RM) $(LIBFILE); \ 66 - find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM) 66 + find $(or $(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM) 67 67 68 68 FORCE: 69 69
+1 -1
tools/objtool/Makefile
··· 13 13 endif 14 14 15 15 SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/ 16 - LIBSUBCMD_OUTPUT = $(if $(OUTPUT),$(OUTPUT),$(CURDIR)/) 16 + LIBSUBCMD_OUTPUT = $(or $(OUTPUT),$(CURDIR)/) 17 17 LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a 18 18 19 19 OBJTOOL := $(OUTPUT)objtool
+1 -1
tools/pci/Makefile
··· 42 42 clean: 43 43 rm -f $(ALL_PROGRAMS) 44 44 rm -rf $(OUTPUT)include/ 45 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 45 + find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 46 46 47 47 install: $(ALL_PROGRAMS) 48 48 install -d -m 755 $(DESTDIR)$(bindir); \
+2 -2
tools/perf/Makefile.perf
··· 724 724 # get relative building directory (to $(OUTPUT)) 725 725 # and '.' if it's $(OUTPUT) itself 726 726 __build-dir = $(subst $(OUTPUT),,$(dir $@)) 727 - build-dir = $(if $(__build-dir),$(__build-dir),.) 727 + build-dir = $(or $(__build-dir),.) 728 728 729 729 prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioctl_array) \ 730 730 $(fadvise_advice_array) \ ··· 1090 1090 1091 1091 clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBPERF)-clean fixdep-clean python-clean bpf-skel-clean 1092 1092 $(call QUIET_CLEAN, core-objs) $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(OUTPUT)perf-iostat $(LANG_BINDINGS) 1093 - $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete 1093 + $(Q)find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete 1094 1094 $(Q)$(RM) $(OUTPUT).config-detected 1095 1095 $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(OUTPUT)pmu-events/jevents $(OUTPUT)$(LIBJVMTI).so 1096 1096 $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
+1 -1
tools/power/x86/intel-speed-select/Makefile
··· 43 43 clean: 44 44 rm -f $(ALL_PROGRAMS) 45 45 rm -rf $(OUTPUT)include/linux/isst_if.h 46 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 46 + find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete 47 47 48 48 install: $(ALL_PROGRAMS) 49 49 install -d -m 755 $(DESTDIR)$(bindir); \
+1 -1
tools/scripts/utilities.mak
··· 175 175 define get-executable-or-default 176 176 $(if $($(1)),$(call _ge_attempt,$($(1)),$(1)),$(call _ge_attempt,$(2))) 177 177 endef 178 - _ge_attempt = $(if $(get-executable),$(get-executable),$(call _gea_err,$(2))) 178 + _ge_attempt = $(or $(get-executable),$(call _gea_err,$(2))) 179 179 _gea_err = $(if $(1),$(error Please set '$(1)' appropriately))
+3 -3
tools/spi/Makefile
··· 53 53 clean: 54 54 rm -f $(ALL_PROGRAMS) 55 55 rm -rf $(OUTPUT)include/ 56 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete 57 - find $(if $(OUTPUT),$(OUTPUT),.) -name '\.*.o.d' -delete 58 - find $(if $(OUTPUT),$(OUTPUT),.) -name '\.*.o.cmd' -delete 56 + find $(or $(OUTPUT),.) -name '*.o' -delete 57 + find $(or $(OUTPUT),.) -name '\.*.o.d' -delete 58 + find $(or $(OUTPUT),.) -name '\.*.o.cmd' -delete 59 59 60 60 install: $(ALL_PROGRAMS) 61 61 install -d -m 755 $(DESTDIR)$(bindir); \
+1 -1
tools/tracing/rtla/Makefile
··· 46 46 DOCDIR := $(DATADIR)/doc 47 47 MANDIR := $(DATADIR)/man 48 48 LICDIR := $(DATADIR)/licenses 49 - SRCTREE := $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR)) 49 + SRCTREE := $(or $(BUILD_SRC),$(CURDIR)) 50 50 51 51 # If running from the tarball, man pages are stored in the Documentation 52 52 # dir. If running from the kernel source, man pages are stored in
+1 -1
tools/usb/Makefile
··· 38 38 39 39 clean: 40 40 rm -f $(ALL_PROGRAMS) 41 - find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete -o -name '\.*.o.cmd' -delete 41 + find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete -o -name '\.*.o.cmd' -delete 42 42 43 43 install: $(ALL_PROGRAMS) 44 44 install -d -m 755 $(DESTDIR)$(bindir); \