Skip to content

Commit 5c5c32d

Browse files
mchehabJonathan Corbet
authored andcommitted
scripts/kernel-doc.py: don't create *.pyc files
As reported by Andy, kernel-doc.py is creating a __pycache__ directory at build time. Disable creation of __pycache__ for the libraries used by kernel-doc.py, when excecuted via the build system or via scripts/find-unused-docs.sh. Reported-by: Andy Shevchenko <andriy.shevchenko@intel.com> Closes: https://lore.kernel.org/linux-doc/Z_zYXAJcTD-c3xTe@black.fi.intel.com/ Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <158b962ed7cd104f7bbfe69f499ec1cc378864db.1745453655.git.mchehab+huawei@kernel.org>
1 parent 110214e commit 5c5c32d

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/gpu/drm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ always-$(CONFIG_DRM_HEADER_TEST) += \
236236
quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
237237
cmd_hdrtest = \
238238
$(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \
239-
$(srctree)/scripts/kernel-doc -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
239+
PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
240240
touch $@
241241

242242
$(obj)/%.hdrtest: $(src)/%.h FORCE

drivers/gpu/drm/i915/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ obj-$(CONFIG_DRM_I915_GVT_KVMGT) += kvmgt.o
408408
#
409409
# Enable locally for CONFIG_DRM_I915_WERROR=y. See also scripts/Makefile.build
410410
ifdef CONFIG_DRM_I915_WERROR
411-
cmd_checkdoc = $(srctree)/scripts/kernel-doc -none -Werror $<
411+
cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none -Werror $<
412412
endif
413413

414414
# header test

include/drm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ always-$(CONFIG_DRM_HEADER_TEST) += \
1111
quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
1212
cmd_hdrtest = \
1313
$(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \
14-
$(srctree)/scripts/kernel-doc -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
14+
PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
1515
touch $@
1616

1717
$(obj)/%.hdrtest: $(src)/%.h FORCE

scripts/Makefile.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ else ifeq ($(KBUILD_CHECKSRC),2)
8383
endif
8484

8585
ifneq ($(KBUILD_EXTRA_WARN),)
86-
cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $(KDOCFLAGS) \
86+
cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(KDOCFLAGS) \
8787
$(if $(findstring 2, $(KBUILD_EXTRA_WARN)), -Wall) \
8888
$<
8989
endif

scripts/find-unused-docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ for file in `find $1 -name '*.c'`; do
5454
if [[ ${FILES_INCLUDED[$file]+_} ]]; then
5555
continue;
5656
fi
57-
str=$(scripts/kernel-doc -export "$file" 2>/dev/null)
57+
str=$(PYTHONDONTWRITEBYTECODE=1 scripts/kernel-doc -export "$file" 2>/dev/null)
5858
if [[ -n "$str" ]]; then
5959
echo "$file"
6060
fi

0 commit comments

Comments
 (0)