Skip to content

Commit 3b9ab24

Browse files
committed
kbuild: use 4-space indentation when followed by conditionals
GNU Make manual [1] clearly forbids a tab at the beginning of the conditional directive line: "Extra spaces are allowed and ignored at the beginning of the conditional directive line, but a tab is not allowed." This will not work for the next release of GNU Make, hence commit 82175d1 ("kbuild: Replace tabs with spaces when followed by conditionals") replaced the inappropriate tabs with 8 spaces. However, the 8-space indentation cannot be visually distinguished. Linus suggested 2-4 spaces for those nested if-statements. [2] This commit redoes the replacement with 4 spaces. [1]: https://www.gnu.org/software/make/manual/make.html#Conditional-Syntax [2]: https://lore.kernel.org/all/CAHk-=whJKZNZWsa-VNDKafS_VfY4a5dAjG-r8BZgWk_a-xSepw@mail.gmail.com/ Suggested-by: Linus Torvalds <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 841c351 commit 3b9ab24

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

Diff for: Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,15 @@ may-sync-config := 1
294294
single-build :=
295295

296296
ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
297-
ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
297+
ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
298298
need-config :=
299-
endif
299+
endif
300300
endif
301301

302302
ifneq ($(filter $(no-sync-config-targets), $(MAKECMDGOALS)),)
303-
ifeq ($(filter-out $(no-sync-config-targets), $(MAKECMDGOALS)),)
303+
ifeq ($(filter-out $(no-sync-config-targets), $(MAKECMDGOALS)),)
304304
may-sync-config :=
305-
endif
305+
endif
306306
endif
307307

308308
need-compiler := $(may-sync-config)
@@ -323,9 +323,9 @@ endif
323323
# We cannot build single targets and the others at the same time
324324
ifneq ($(filter $(single-targets), $(MAKECMDGOALS)),)
325325
single-build := 1
326-
ifneq ($(filter-out $(single-targets), $(MAKECMDGOALS)),)
326+
ifneq ($(filter-out $(single-targets), $(MAKECMDGOALS)),)
327327
mixed-build := 1
328-
endif
328+
endif
329329
endif
330330

331331
# For "make -j clean all", "make -j mrproper defconfig all", etc.

Diff for: arch/m68k/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
KBUILD_DEFCONFIG := multi_defconfig
1616

1717
ifdef cross_compiling
18-
ifeq ($(CROSS_COMPILE),)
18+
ifeq ($(CROSS_COMPILE),)
1919
CROSS_COMPILE := $(call cc-cross-prefix, \
2020
m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
21-
endif
21+
endif
2222
endif
2323

2424
#

Diff for: arch/parisc/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ export CROSS32CC
5050

5151
# Set default cross compiler for kernel build
5252
ifdef cross_compiling
53-
ifeq ($(CROSS_COMPILE),)
53+
ifeq ($(CROSS_COMPILE),)
5454
CC_SUFFIXES = linux linux-gnu unknown-linux-gnu suse-linux
5555
CROSS_COMPILE := $(call cc-cross-prefix, \
5656
$(foreach a,$(CC_ARCHES), \
5757
$(foreach s,$(CC_SUFFIXES),$(a)-$(s)-)))
58-
endif
58+
endif
5959
endif
6060

6161
ifdef CONFIG_DYNAMIC_FTRACE

Diff for: arch/x86/Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ ifeq ($(CONFIG_X86_32),y)
112112
# temporary until string.h is fixed
113113
KBUILD_CFLAGS += -ffreestanding
114114

115-
ifeq ($(CONFIG_STACKPROTECTOR),y)
116-
ifeq ($(CONFIG_SMP),y)
115+
ifeq ($(CONFIG_STACKPROTECTOR),y)
116+
ifeq ($(CONFIG_SMP),y)
117117
KBUILD_CFLAGS += -mstack-protector-guard-reg=fs -mstack-protector-guard-symbol=__stack_chk_guard
118-
else
118+
else
119119
KBUILD_CFLAGS += -mstack-protector-guard=global
120-
endif
121120
endif
121+
endif
122122
else
123123
BITS := 64
124124
UTS_MACHINE := x86_64

0 commit comments

Comments
 (0)