Skip to content

Commit bcb4edf

Browse files
peffgitster
authored andcommitted
coccicheck: make batch size of 0 mean "unlimited"
If you have the memory to handle it, the ideal case is to run a single spatch invocation with all of the source files. But the only way to do so now is to pick an arbitrarily large batch size. Let's make "0" do this, which is a little friendlier (and doesn't otherwise have a useful meaning). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 960154b commit bcb4edf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,7 @@ SP_EXTRA_FLAGS =
11761176

11771177
# For the 'coccicheck' target; setting SPATCH_BATCH_SIZE higher will
11781178
# usually result in less CPU usage at the cost of higher peak memory.
1179+
# Setting it to 0 will feed all files in a single spatch invocation.
11791180
SPATCH_FLAGS = --all-includes --patch .
11801181
SPATCH_BATCH_SIZE = 1
11811182

@@ -2792,7 +2793,12 @@ endif
27922793

27932794
%.cocci.patch: %.cocci $(COCCI_SOURCES)
27942795
@echo ' ' SPATCH $<; \
2795-
if ! echo $(COCCI_SOURCES) | xargs -n $(SPATCH_BATCH_SIZE) \
2796+
if test $(SPATCH_BATCH_SIZE) = 0; then \
2797+
limit=; \
2798+
else \
2799+
limit='-n $(SPATCH_BATCH_SIZE)'; \
2800+
fi; \
2801+
if ! echo $(COCCI_SOURCES) | xargs $$limit \
27962802
$(SPATCH) --sp-file $< $(SPATCH_FLAGS) \
27972803
>$@+ 2>$@.log; \
27982804
then \

0 commit comments

Comments
 (0)