summaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)Author
2024-01-03scripts/get_abi: fix source path leakVegard Nossum
The code currently leaks the absolute path of the ABI files into the rendered documentation. There exists code to prevent this, but it is not effective when an absolute path is passed, which it is when $srctree is used. I consider this to be a minimal, stop-gap fix; a better fix would strip off the actual prefix instead of hacking it off with a regex. Link: https://mastodon.social/@vegard/111677490643495163 Cc: Jani Nikula <jani.nikula@intel.com> Cc: stable@vger.kernel.org Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20231231235959.3342928-1-vegard.nossum@oracle.com
2023-12-31get_maintainer: remove stray punctuation when cleaning file emailsAlvin Šipraga
When parsing emails from .yaml files in particular, stray punctuation such as a leading '-' can end up in the name. For example, consider a common YAML section such as: maintainers: - devicetree@vger.kernel.org This would previously be processed by get_maintainer.pl as: - <devicetree@vger.kernel.org> Make the logic in clean_file_emails more robust by deleting any sub-names which consist of common single punctuation marks before proceeding to the best-effort name extraction logic. The output is then correct: devicetree@vger.kernel.org Some additional comments are added to the function to make things clearer to future readers. Link: https://lore.kernel.org/all/0173e76a36b3a9b4e7f324dd3a36fd4a9757f302.camel@perches.com/ Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2023-12-31get_maintainer: correctly parse UTF-8 encoded names in filesAlvin Šipraga
While the script correctly extracts UTF-8 encoded names from the MAINTAINERS file, the regular expressions damage my name when parsing from .yaml files. Fix this by replacing the Latin-1-compatible regular expressions with the unicode property matcher \p{L}, which matches on any letter according to the Unicode General Category of letters. The proposed solution only works if the script uses proper string encoding from the outset, so instruct Perl to unconditionally open all files with UTF-8 encoding. This should be safe, as the entire source tree is either UTF-8 or ASCII encoded anyway. See [1] for a detailed analysis. Furthermore, to prevent the \w expression from matching non-ASCII when checking for whether a name should be escaped with quotes, add the /a flag to the regular expression. The escaping logic was duplicated in two places, so it has been factored out into its own function. The original issue was also identified on the tools mailing list [2]. This should solve the observed side effects there as well. Link: https://lore.kernel.org/all/dzn6uco4c45oaa3ia4u37uo5mlt33obecv7gghj2l756fr4hdh@mt3cprft3tmq/ [1] Link: https://lore.kernel.org/tools/20230726-gush-slouching-a5cd41@meerkat/ [2] Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2023-12-29scripts/decode_stacktrace.sh: strip unexpected CR from linesBjorn Andersson
When the kernel log is acquired over a serial cable it is not uncommon for the log to contain carriage return characters, in addition to the expected line feeds. When this output is feed into decode_stacktrace.sh, handle_line() fails to strip the trailing ']' off the module name, which results in find_module() not being able to find the referred to kernel module. This is reported to the user as: WARNING! Modules path isn't set, but is needed to parse this symbol The solution is to reconfigure the serial port, or to strip the carriage returns from the log, but this isn't obvious from the error reported by the script. Instead, make decode_stacktrace.sh more user friendly by stripping the trailing carriage return. Link: https://lkml.kernel.org/r/20231225-decode-stacktrace-cr-v1-1-9f306f38cdde@quicinc.com Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-29scripts/checkstack.pl: fix no space expression between sp and offsetKuan-Ying Lee
When I use older version aarch64 objdump (2.24) to disassemble aarch64 vmlinux, I get the result like below. There is no space between sp and offset. ffff800008010000 <dw_apb_ictl_handle_irq>: ffff800008010000: d503233f hint #0x19 ffff800008010004: a9bc7bfd stp x29, x30, [sp,#-64]! ffff800008010008: 90011e60 adrp x0, ffff80000a3dc000 <num_ictlrs> ffff80000801000c: 910003fd mov x29, sp ffff800008010010: a9025bf5 stp x21, x22, [sp,#32] When I use newer version aarch64 objdump (2.35), I get the result like below. There is a space between sp and offset. ffff800008010000 <dw_apb_ictl_handle_irq>: ffff800008010000: d503233f paciasp ffff800008010004: a9bc7bfd stp x29, x30, [sp, #-64]! ffff800008010008: 90011e60 adrp x0, ffff80000a3dc000 <num_ictlrs> ffff80000801000c: 910003fd mov x29, sp ffff800008010010: a9025bf5 stp x21, x22, [sp, #32] Add no space support of regular expression for old version objdump. Link: https://lkml.kernel.org/r/20231220073629.2658-1-Kuan-Ying.Lee@mediatek.com Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com> Cc: Casper Li <casper.li@mediatek.com> Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Cc: Chinwen Chang <chinwen.chang@mediatek.com> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: Qun-Wei Lin <qun-wei.lin@mediatek.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-29scripts/checkstack.pl: change min_stack to 512 by defaultTiezhu Yang
According to Documentation/process/submit-checklist.rst, checkstack does not point out problems explicitly, but any one function that uses more than 512 bytes on the stack is a candidate for change, hence it is better to omit any stack frame sizes smaller than 512 bytes, just change min_stack to 512 by default. Link: https://lkml.kernel.org/r/20231219125008.23007-5-yangtiezhu@loongson.cn Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-29scripts/checkstack.pl: match all stack sizes for some archsTiezhu Yang
For some unknown reason the regular expression for checkstack only matches three digit numbers starting with the number "3", or any higher number. Which means that it skips any stack sizes smaller than 304 bytes. This makes the checkstack script a bit less useful than it could be. Change the script to match any number. To be filtered out stack sizes can be configured with the min_stack variable, which omits any stack frame sizes smaller than 100 bytes by default. This is similar with commit aab1f809d754 ("scripts/checkstack.pl: match all stack sizes for s390"). Link: https://lkml.kernel.org/r/20231219125008.23007-4-yangtiezhu@loongson.cn Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-29scripts/checkstack.pl: add min_stack to the usage commentTiezhu Yang
After commit 572220aad525 ("scripts/checkstack.pl: Add argument to print stacks greather than value."), it is appropriate to add min_stack to the usage comment, then the users know explicitly that "min_stack" can be specified like "arch". Link: https://lkml.kernel.org/r/20231219125008.23007-3-yangtiezhu@loongson.cn Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-29scripts/checkstack.pl: remove ia64 supportTiezhu Yang
Patch series "Modify some code about checkstack". This patch (of 5): After commit cf8e8658100d ("arch: Remove Itanium (IA-64) architecture"), the ia64 port has been removed from the kernel, so also remove the ia64 specific bits from the checkstack.pl script. Link: https://lkml.kernel.org/r/20231219125008.23007-1-yangtiezhu@loongson.cn Link: https://lkml.kernel.org/r/20231219125008.23007-2-yangtiezhu@loongson.cn Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-29checkstack: add loongarch support for scripts/checkstack.plYouling Tang
scripts/checkstack.pl lacks support for the loongarch architecture. Add support to detect "addi.{w,d} $sp, $sp, -FRAME_SIZE" stack frame generation instruction. Link: https://lkml.kernel.org/r/MW4PR84MB314514273F0B7DBCC5E35A978192A@MW4PR84MB3145.NAMPRD84.PROD.OUTLOOK.COM Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Acked-by: Huacai Chen <chenhuacai@loongson.cn> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-29scripts/decodecode: add support for LoongArchYouling Tang
An example how to invoke decodecode for loongarch64: $ echo 'Code: 380839f6 380831f9 28412bae <24000ca6> 004081ad 0014cb50 004083e8 02bff34c 58008e91' | \ ARCH=loongarch CROSS_COMPILE=loongarch64-linux-gnu- \ ./scripts/decodecode Code: 380839f6 380831f9 28412bae <24000ca6> 004081ad 0014cb50 004083e8 02bff34c 58008e91 All code ======== 0: 380839f6 ldx.w $fp, $t3, $t2 4: 380831f9 ldx.w $s2, $t3, $t0 8: 28412bae ld.h $t2, $s6, 74(0x4a) c:* 24000ca6 ldptr.w $a2, $a1, 12(0xc) <-- trapping instruction 10: 004081ad slli.w $t1, $t1, 0x0 14: 0014cb50 and $t4, $s3, $t6 18: 004083e8 slli.w $a4, $s8, 0x0 1c: 02bff34c addi.w $t0, $s3, -4(0xffc) 20: 58008e91 beq $t8, $t5, 140(0x8c) # 0xac Code starting with the faulting instruction =========================================== 0: 24000ca6 ldptr.w $a2, $a1, 12(0xc) 4: 004081ad slli.w $t1, $t1, 0x0 8: 0014cb50 and $t4, $s3, $t6 c: 004083e8 slli.w $a4, $s8, 0x0 10: 02bff34c addi.w $t0, $s3, -4(0xffc) 14: 58008e91 beq $t8, $t5, 140(0x8c) # 0xa0 Link: https://lkml.kernel.org/r/MW4PR84MB3145B99B9677BB7887BB26CD8192A@MW4PR84MB3145.NAMPRD84.PROD.OUTLOOK.COM Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Acked-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-29kbuild: deb-pkg: squash scripts/package/deb-build-option to debian/rulesMasahiro Yamada
The binary-arch target needs to use the same CROSS_COMPILE as used in build-arch; otherwise, 'make run-command' may attempt to resync the .config file. Squash scripts/package/deb-build-option into debian/rules, as it is a small amount of code. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <n.schier@avm.de>
2023-12-29kbuild: deb-pkg: factor out common Make options in debian/rulesMasahiro Yamada
This avoids code duplication between binary-arch and built-arch. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <n.schier@avm.de>
2023-12-29kbuild: deb-pkg: hard-code Build-DependsMasahiro Yamada
The condition to require libelf-dev:native is stale because objtool is now enabled by CONFIG_OBJTOOL instead of CONFIG_UNWINDER_ORC. Not only objtool but also resolve_btfids requires libelf-dev:native; therefore, CONFIG_DEBUG_INFO_BTF should be checked as well. Similarly, CONFIG_SYSTEM_TRUSTED_KEYRING is not the only case that requires libssl-dev:native. Perhaps, the following code would provide better coverage, but it is hard to maintain (and may still be imperfect). if is_enabled CONFIG_OBJTOOL || is_enabled CONFIG_DEBUG_INFO_BTF; then build_depends="${build_depends}, libelf-dev:native" fi if is_enabled CONFIG_SYSTEM_TRUSTED_KEYRING || is_enabled CONFIG_SYSTEM_REVOCATION_LIST || is_enabled CONFIG_MODULE_SIG_FORMAT; then build_depends="${build_depends}, libssl-dev:native" fi Let's hard-code the build dependency. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <n.schier@avm.de>
2023-12-29kbuild: deb-pkg: split debian/copyright from the mkdebian scriptMasahiro Yamada
Copy debian/copyright instead of generating it by the 'cat' command. I also updated '2018' to '2023' while I was here. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <n.schier@avm.de>
2023-12-29check-uapi: Introduce check-uapi.shJohn Moon
While the kernel community has been good at maintaining backwards compatibility with kernel UAPIs, it would be helpful to have a tool to check if a commit introduces changes that break backwards compatibility. To that end, introduce check-uapi.sh: a simple shell script that checks for changes to UAPI headers using libabigail. libabigail is "a framework which aims at helping developers and software distributors to spot some ABI-related issues like interface incompatibility in ELF shared libraries by performing a static analysis of the ELF binaries at hand." The script uses one of libabigail's tools, "abidiff", to compile the changed header before and after the commit to detect any changes. abidiff "compares the ABI of two shared libraries in ELF format. It emits a meaningful report describing the differences between the two ABIs." The script also includes the ability to check the compatibility of all UAPI headers across commits. This allows developers to inspect the stability of the UAPIs over time. Signed-off-by: John Moon <quic_johmoo@quicinc.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-12-29scripts: Introduce a default git.orderFileLeonardo Bras
When reviewing patches, it looks much nicer to have some changes shown before others, which allow better understanding of the patch before the the .c files reviewing. Introduce a default git.orderFile, in order to help developers getting the best ordering easier. Signed-off-by: Leonardo Bras <leobras@redhat.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-12-29kconfig: WERROR unmet symbol dependencySergey Senozhatsky
When KCONFIG_WERROR env variable is set treat unmet direct symbol dependency as a terminal condition (error). Suggested-by: Stefan Reinauer <reinauer@google.com> Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-12-28Merge tag 'kbuild-fixes-v6.7-2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Revive proper alignment for the ksymtab and kcrctab sections - Fix gen_compile_commands.py tool to resolve symbolic links - Fix symbolic links to installed debug VDSO files - Update MAINTAINERS * tag 'kbuild-fixes-v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: linux/export: Ensure natural alignment of kcrctab array kbuild: fix build ID symlinks to installed debug VDSO files gen_compile_commands.py: fix path resolve with symlinks in it MAINTAINERS: Add scripts/clang-tools to Kbuild section linux/export: Fix alignment for 64-bit ksymtab entries
2023-12-28kconfig: Use KCONFIG_CONFIG instead of .configMarkus Schneider-Pargmann
When using a custom location for kernel config files this merge config command fails as it doesn't use the configuration set with KCONFIG_CONFIG. Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-12-28kconfig: remove redundant NULL pointer check before free()Masahiro Yamada
Passing NULL to free() is allowed and is a no-op. Remove redundant NULL pointer checks. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-12-28kconfig: remove unreachable printf()Masahiro Yamada
Remove the unreachable code detected by clang. $ make HOSTCC=clang HOSTCFLAGS=-Wunreachable-code defconfig [ snip ] scripts/kconfig/expr.c:1134:2: warning: code will never be executed [-Wunreachable-code] printf("[%dgt%d?]", t1, t2); ^~~~~~ 1 warning generated. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-12-28kconfig: add include guard to lkc_proto.hMasahiro Yamada
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-12-28kconfig: squash menu_has_help() and menu_get_help()Masahiro Yamada
menu_has_help() and menu_get_help() functions are only used within menu_get_ext_help(). Squash them into menu_get_ext_help(). It revealed the if-conditional in menu_get_help() was unneeded, as menu_has_help() has already checked that menu->help is not NULL. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-12-23kbuild: fix build ID symlinks to installed debug VDSO filesMasahiro Yamada
Commit 56769ba4b297 ("kbuild: unify vdso_install rules") accidentally dropped the '.debug' suffix from the build ID symlinks. Fixes: 56769ba4b297 ("kbuild: unify vdso_install rules") Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-12-23gen_compile_commands.py: fix path resolve with symlinks in itJialu Xu
When a path contains relative symbolic links, os.path.abspath() might not follow the symlinks and instead return the absolute path with just the relative paths resolved, resulting in an incorrect path. 1. Say "drivers/hdf/" has some symlinks: # ls -l drivers/hdf/ total 364 drwxrwxr-x 2 ... 4096 ... evdev lrwxrwxrwx 1 ... 44 ... framework -> ../../../../../../drivers/hdf_core/framework -rw-rw-r-- 1 ... 359010 ... hdf_macro_test.h lrwxrwxrwx 1 ... 55 ... inner_api -> ../../../../../../drivers/hdf_core/interfaces/inner_api lrwxrwxrwx 1 ... 53 ... khdf -> ../../../../../../drivers/hdf_core/adapter/khdf/linux -rw-r--r-- 1 ... 74 ... Makefile drwxrwxr-x 3 ... 4096 ... wifi 2. One .cmd file records that: # head -1 ./framework/core/manager/src/.devmgr_service.o.cmd cmd_drivers/hdf/khdf/manager/../../../../framework/core/manager/src/devmgr_service.o := ... \ /path/to/src/drivers/hdf/khdf/manager/../../../../framework/core/manager/src/devmgr_service.c 3. os.path.abspath returns "/path/to/src/framework/core/manager/src/devmgr_service.c", not correct: # ./scripts/clang-tools/gen_compile_commands.py INFO: Could not add line from ./framework/core/manager/src/.devmgr_service.o.cmd: File \ /path/to/src/framework/core/manager/src/devmgr_service.c not found Use os.path.realpath(), which resolves the symlinks and normalizes the paths correctly. # cat compile_commands.json ... { "command": ... "directory": ... "file": "/path/to/bla/drivers/hdf_core/framework/core/manager/src/devmgr_service.c" }, ... Also fix it in parse_arguments(). Signed-off-by: Jialu Xu <xujialu@vimux.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-12-21rust: upgrade to Rust 1.74.1Miguel Ojeda
This is the next upgrade to the Rust toolchain, from 1.73.0 to 1.74.1 (i.e. the latest) [1]. See the upgrade policy [2] and the comments on the first upgrade in commit 3ed03f4da06e ("rust: upgrade to Rust 1.68.2"). # Unstable features No unstable features (that we use) were stabilized. Therefore, the only unstable features allowed to be used outside the `kernel` crate are still `new_uninit,offset_of`, though other code to be upstreamed may increase the list (e.g. `offset_of` was added recently). Please see [3] for details. # Other improvements Rust 1.74.0 allows to use `#[repr(Rust)]` explicitly [4], which can be useful to be explicit about particular cases that would normally use e.g. the C representation, such as silencing lints like the upcoming additions we requested [5] to the `no_mangle_with_rust_abi` Clippy lint (which in turn triggered the `#[repr(Rust)]` addition). Rust 1.74.0 includes a fix for one of the false negative cases we reported in Clippy's `disallowed_macros` lint [6] that we would like to use in the future. Rust 1.74.1 fixes an ICE that the Apple AGX GPU driver was hitting [7]. # Required changes For this upgrade, no changes were required (i.e. on our side). # `alloc` upgrade and reviewing The vast majority of changes are due to our `alloc` fork being upgraded at once. There are two kinds of changes to be aware of: the ones coming from upstream, which we should follow as closely as possible, and the updates needed in our added fallible APIs to keep them matching the newer infallible APIs coming from upstream. Instead of taking a look at the diff of this patch, an alternative approach is reviewing a diff of the changes between upstream `alloc` and the kernel's. This allows to easily inspect the kernel additions only, especially to check if the fallible methods we already have still match the infallible ones in the new version coming from upstream. Another approach is reviewing the changes introduced in the additions in the kernel fork between the two versions. This is useful to spot potentially unintended changes to our additions. To apply these approaches, one may follow steps similar to the following to generate a pair of patches that show the differences between upstream Rust and the kernel (for the subset of `alloc` we use) before and after applying this patch: # Get the difference with respect to the old version. git -C rust checkout $(linux/scripts/min-tool-version.sh rustc) git -C linux ls-tree -r --name-only HEAD -- rust/alloc | cut -d/ -f3- | grep -Fv README.md | xargs -IPATH cp rust/library/alloc/src/PATH linux/rust/alloc/PATH git -C linux diff --patch-with-stat --summary -R > old.patch git -C linux restore rust/alloc # Apply this patch. git -C linux am rust-upgrade.patch # Get the difference with respect to the new version. git -C rust checkout $(linux/scripts/min-tool-version.sh rustc) git -C linux ls-tree -r --name-only HEAD -- rust/alloc | cut -d/ -f3- | grep -Fv README.md | xargs -IPATH cp rust/library/alloc/src/PATH linux/rust/alloc/PATH git -C linux diff --patch-with-stat --summary -R > new.patch git -C linux restore rust/alloc Now one may check the `new.patch` to take a look at the additions (first approach) or at the difference between those two patches (second approach). For the latter, a side-by-side tool is recommended. Link: https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1741-2023-12-07 [1] Link: https://rust-for-linux.com/rust-version-policy [2] Link: https://github.com/Rust-for-Linux/linux/issues/2 [3] Link: https://github.com/rust-lang/rust/pull/114201 [4] Link: https://github.com/rust-lang/rust-clippy/issues/11219 [5] Link: https://github.com/rust-lang/rust-clippy/issues/11431 [6] Link: https://github.com/rust-lang/rust/issues/117976#issuecomment-1822225691 [7] Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Benno Lossin <benno.lossin@proton.me> Tested-by: David Gow <davidgow@google.com> Link: https://lore.kernel.org/r/20231214092958.377061-1-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-20Makefile.extrawarn: turn on missing-prototypes globallyArnd Bergmann
Over the years we went from > 1000 of warnings to under 100 earlier this year, and I sent patches to address all the ones that I saw with compile testing randcom configs on arm64, arm and x86 kernels. This is a really useful warning, as it catches real bugs when there are mismatched prototypes. In particular with kernel control flow integrity enabled, those are no longer allowed. I have done extensive testing to ensure that there are no new build errors or warnings on any configuration of x86, arm and arm64 builds. I also made sure that at least both the normal defconfig and an allmodconfig build is clean for arc, csky, loongarch, m68k, microblaze, openrisc, parisc, powerpc, riscv, s390, and xtensa, with the respective maintainers doing most of the patches. At this point, there are five architectures with a number of known regressions: alpha, nios2, mips, sh and sparc. In the previous version of this patch, I had turned off the missing prototype warnings for the 15 architectures that still had issues, but since there are only five left, I think we can leave the rest to the maintainers (Cc'd here) as well. Link: https://lkml.kernel.org/r/20231123110506.707903-7-arnd@kernel.org Link: https://lore.kernel.org/lkml/20230810141947.1236730-1-arnd@kernel.org/ Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Palmer Dabbelt <palmer@rivosinc.com> # RISC-V Cc: Richard Henderson <richard.henderson@linaro.org> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Matt Turner <mattst88@gmail.com> Cc: Dinh Nguyen <dinguyen@kernel.org> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Rich Felker <dalias@libc.org> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Cc: "David S. Miller" <davem@davemloft.net> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Nicolas Schier <nicolas@fjasle.eu> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Richard Weinberger <richard@nod.at> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Tudor Ambarus <tudor.ambarus@linaro.org> Cc: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-20Merge tag 'iio-for-6.8a' of ↵Greg Kroah-Hartman
https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next Jonathan writes: 1st set of IIO new device support, features and cleanup for 6.8 New device support ------------------ adi,hmc425a * Add support for ADRF5740 attenuators. Minor changes to driver needed alongside new IDs. aosong,ags02ma * New driver for this volatile organic compounds sensor. bosch,bmp280 * Add BMP390 (small amount of refactoring + ID) bosch,bmi323 * New driver to support the BMI323 6-axis IMU. honeywell,hsc030pa * New driver supporting a huge number of SSC and HSC series pressure and temperature sensors. isil,isl76682 * New driver for this simple Ambient Light sensor. liteon,ltr390 * New driver for this ambient and ultraviolet light sensor. maxim,max34408 * New driver to support the MAX34408 and MAX34409 current monitoring ADCs. melexis,mlx90635 * New driver for this Infrared contactless temperature sensor. mirochip,mcp9600 * New driver for this thermocouple EMF convertor. ti,hdc3020 * New driver for this integrated relative humidity and temperature sensor. vishay,veml6075 * New driver for this UVA and UVB light sensor. General features ---------------- Device properties * Add fwnode_property_match_property_string() helper to allow matching single value property against an array of predefined strings. * Use fwnode_property_string_array_count() inside fwnode_property_match_string() instead of open coding the same. checkpatch.pl * Add exclusion of __aligned() from a warning reducing false positives on IIO drivers (and hopefully beyond) IIO Features ------------ core * New light channel modifiers for UVA and UVB. * Add IIO_CHAN_INFO_TROUGH as counterpart to IIO_CHAN_INFO_PEAK so that we can support device that keep running track of the lowest value they have seen in similar fashion to the existing peak tracking. adi,adis library * Use spi cs inactive delay even when a burst reading is performed. As it's now used every time, can centralize the handling in the SPI setup code in the driver. adi,ad2s1210 * Support for fixed-mode to this resolver driver where the A0 and A1 pins are hard wired to config mode in which case position and config must be read from appropriate config registers. * Support reset GPIO if present. adi,ad5791 * Allow configuration of presence of external amplifier in DT binding. adi,adis16400 * Add spi-cs-inactive-delay-ns to bindings to allow it to be tweaked if default delays are not quite enough for a specific board. adi,adis16475 * Add spi-cs-inactive-delay-ns to bindings to allow it to be tweaked if default delays are not quite enough for a specific board. bosch,bmp280 * Enable multiple chip IDs per family of devices. rohm,bu27008 * Add an illuminance channel calculated from RGB and IR data. Cleanup ------- Minor white space, typos and tidy up not explicitly called out. Core * Check that the available_scan_masks array passed to the IIO core by a driver is sensible by ensuring the entries are ordered so the minimum number of channels is enabled in the earlier entries (as they will be selected if sufficient for the requested channels). * Document that the available_scan_masks infrastructure doesn't currently handle masks that don't fit in a long int. * Improve intensity documentation to reflect that there is no expectation of sensible units (it's dependent on a frequency sensitivity curve) Various * Use new device_property_match_property_string() to replace open coded versions of the same thing. * Fix a few MAINTAINERS filenames. * i2c_get_match_data() and spi_get_device_match_data() pushed into more drivers reducing boilerplate handling. * Some unnecessary headers removed. * ACPI_PTR() removals. It's rarely worth using this. adi,ad7091r (early part of a series adding device support - useful in their own right) * Pass iio_dev directly an event handler rather than relying on broken use of dev_get_drvdata() as drvdata is never set in this driver. * Make sure alert is turned on. adi,ad9467 (general driver fixing up as precursor to iio-backend proposal which is under review for 6.9) * Fix reset gpio handling to match expected polarity. * Always handle error codes from spi_writes. * Add a driver instance local mutex to avoid some races. * Fix scale setting to align with available scale values. * Split array of chip_info structures up into named individual elements. * Convert to regmap. honeywell,mprls0025pa * Drop now unnecessary type references in DT binding for properties in pascals. invensense,mpu6050 * Don't eat a potentially useful return value from regmap_bulk_write() invensense,icm42600 * Use max macro to improve code readability and save a few lines. liteon,ltrf216a * Improve prevision of light intensity. microchip,mcp3911 * Use cleanup.h magic. qcom,spmi* * Fix wrong descriptions of SPMI reg fields in bindings. Other ---- mailmap * Update for Matt Ranostay * tag 'iio-for-6.8a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (83 commits) iio: adc: ad7091r: Align arguments to function call parenthesis iio: adc: ad7091r: Set alert bit in config register iio: adc: ad7091r: Pass iio_dev to event handler scripts: checkpatch: Add __aligned to the list of attribute notes iio: chemical: add support for Aosong AGS02MA dt-bindings: iio: chemical: add aosong,ags02ma dt-bindings: vendor-prefixes: add aosong iio: accel: bmi088: update comments and Kconfig dt-bindings: iio: humidity: Add TI HDC302x support iio: humidity: Add driver for ti HDC302x humidity sensors iio: ABI: document temperature and humidity peak/trough raw attributes iio: core: introduce trough info element for minimum values iio: light: driver for Lite-On ltr390 dt-bindings: iio: light: add ltr390 iio: light: isl76682: remove unreachable code iio: pressure: driver for Honeywell HSC/SSC series dt-bindings: iio: pressure: add honeywell,hsc030 doc: iio: Document intensity scale as poorly defined dt-bindings: iio: temperature: add MLX90635 device iio: temperature: mlx90635 MLX90635 IR Temperature sensor ...
2023-12-19kernel-doc: Align quick help and the codeAndy Shevchenko
The update to the quick help mentions -Wshort-description, but code never supported for that. Align that with the code by allowing both: -Wshort-description and -Wshort-desc. Fixes: 56b0f453db74 ("kernel-doc: don't let V=1 change outcome") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20231215150341.1996720-1-andriy.shevchenko@linux.intel.com
2023-12-18docs: ignore __counted_by attribute in structure definitionsJonathan Corbet
kernel-doc appeared to ignore __counted_by, but appearances can be deceiving; it caused member names to not be recognized, which manifested as a number of spurious "Excess struct member" warnings. Filter that attribute out and reduce the warning onslaught slightly. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2023-12-17scripts: checkpatch: Add __aligned to the list of attribute notesMarcelo Schmitt
Checkpatch presumes attributes marked with __aligned(alignment) are part of a function declaration and throws a warning stating that those compiler attributes should have an identifier name which is not correct. Add __aligned compiler attributes to the list of attribute notes so they don't cause warnings anymore. Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com> Acked-by: Joe Perches <joe@perches.com> Link: https://lore.kernel.org/r/1c5c93ecbd8c46a338b22a4ef52e51648e333c01.1702746240.git.marcelo.schmitt1@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-12-15scripts: kernel-doc: Clarify missing struct member descriptionKees Cook
The output "or member" should be more specific, instead saying "struct member". Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20231215001513.work.563-kees@kernel.org
2023-12-15scripts/kernel-doc: restore warning for Excess struct/unionRandy Dunlap
The warning for Excess struct or union member description was removed when the $nested parameter of check_sections() was removed. This causes some kernel-doc notation warnings to be missed. Recently the kernel test robot somehow reported an Excess member. The code in kernel-doc has not issued that warning since kernel v4.16, so I don't know how the robot did it. (See the Link for the report.) drivers/net/wireless/intel/iwlwifi/fw/dbg.c:86: warning: Excess struct/union/enum/typedef member 'trans_len' description in 'iwl_fw_dump_ptrs' I patched that warning away even though I could not reproduce the warning from kernel-doc. The warning should be issued for extraneous struct member or union member description, so restore it. Fixes: 1081de2d2f91 ("scripts: kernel-doc: get rid of $nested parameter") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Link: https://lore.kernel.org/all/202312060810.QT9zourt-lkp@intel.com/ Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20231214070200.24405-1-rdunlap@infradead.org
2023-12-15docs: Raise the minimum Sphinx requirement to 2.4.4Jonathan Corbet
Commit 31abfdda6527 (docs: Deprecate use of Sphinx < 2.4.x) in 6.2 added a warning that support for older versions of Sphinx would be going away. There have been no complaints, so the time has come. Raise the minimum Sphinx version to 2.4.4 and clean out some compatibility code that we no longer need. Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org> Link: https://lore.kernel.org/r/874jgs47fq.fsf@meer.lwn.net Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2023-12-14Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski
Cross-merge networking fixes after downstream PR. Conflicts: drivers/net/ethernet/intel/iavf/iavf_ethtool.c 3a0b5a2929fd ("iavf: Introduce new state machines for flow director") 95260816b489 ("iavf: use iavf_schedule_aq_request() helper") https://lore.kernel.org/all/84e12519-04dc-bd80-bc34-8cf50d7898ce@intel.com/ drivers/net/ethernet/broadcom/bnxt/bnxt.c c13e268c0768 ("bnxt_en: Fix HWTSTAMP_FILTER_ALL packet timestamp logic") c2f8063309da ("bnxt_en: Refactor RX VLAN acceleration logic.") a7445d69809f ("bnxt_en: Add support for new RX and TPA_START completion types for P7") 1c7fd6ee2fe4 ("bnxt_en: Rename some macros for the P5 chips") https://lore.kernel.org/all/20231211110022.27926ad9@canb.auug.org.au/ drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c bd6781c18cb5 ("bnxt_en: Fix wrong return value check in bnxt_close_nic()") 84793a499578 ("bnxt_en: Skip nic close/open when configuring tstamp filters") https://lore.kernel.org/all/20231214113041.3a0c003c@canb.auug.org.au/ drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c 3d7a3f2612d7 ("net/mlx5: Nack sync reset request when HotPlug is enabled") cecf44ea1a1f ("net/mlx5: Allow sync reset flow when BF MGT interface device is present") https://lore.kernel.org/all/20231211110328.76c925af@canb.auug.org.au/ No adjacent changes. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-12-14rust: Suppress searching builtin sysrootMatthew Maurer
By default, if Rust is passed `--target=foo` rather than a target.json file, it will infer a default sysroot if that component is installed. As the proposed aarch64 support [1] uses `aarch64-unknown-none` rather than a target.json file, this is needed [2] to prevent rustc from being confused between the custom kernel sysroot and the pre-installed one. [ Miguel: Applied Boqun's extra case (for `rusttest`) and reworded to add links to the arm64 patch series discussion. In addition, fixed the `rustdoc` target too (which requires a conditional since `cmd_rustdoc` is also used for host crates like `macros`). ] Signed-off-by: Matthew Maurer <mmaurer@google.com> Tested-by: Boqun Feng <boqun.feng@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/rust-for-linux/20231020155056.3495121-1-Jamie.Cunliffe@arm.com/ [1] Link: https://lore.kernel.org/rust-for-linux/CAGSQo01pOixiPXkW867h4vPUaAjtKtHGKhkV-rpifJvKxAf4Ww@mail.gmail.com/ [2] Link: https://lore.kernel.org/r/20231031201752.1189213-1-mmaurer@google.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-13sign-file: Fix incorrect return values checkYusong Gao
There are some wrong return values check in sign-file when call OpenSSL API. The ERR() check cond is wrong because of the program only check the return value is < 0 which ignored the return val is 0. For example: 1. CMS_final() return 1 for success or 0 for failure. 2. i2d_CMS_bio_stream() returns 1 for success or 0 for failure. 3. i2d_TYPEbio() return 1 for success and 0 for failure. 4. BIO_free() return 1 for success and 0 for failure. Link: https://www.openssl.org/docs/manmaster/man3/ Fixes: e5a2e3c84782 ("scripts/sign-file.c: Add support for signing with a raw signature") Signed-off-by: Yusong Gao <a869920004@gmail.com> Reviewed-by: Juerg Haefliger <juerg.haefliger@canonical.com> Signed-off-by: David Howells <dhowells@redhat.com> Link: https://lore.kernel.org/r/20231213024405.624692-1-a869920004@gmail.com/ # v5 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2023-12-10scripts/gdb: remove exception handling and refine print formatKuan-Ying Lee
1. When we crash on a page, we want to check what happened on this page instead of skipping this page by try-except block. Thus, removing the try-except block. 2. Remove redundant comma and print the task name properly. Link: https://lkml.kernel.org/r/20231127070404.4192-4-Kuan-Ying.Lee@mediatek.com Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com> Cc: Andrey Konovalov <andreyknvl@google.com> Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Cc: Chinwen Chang <chinwen.chang@mediatek.com> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Qun-Wei Lin <qun-wei.lin@mediatek.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-10scripts/gdb/stackdepot: rename pool_index to pools_numKuan-Ying Lee
After stackdepot evicting support patchset[1], we rename pool_index to pools_num. To avoid from the below issue, we rename consistently in gdb scripts. Python Exception <class 'gdb.error'>: No symbol "pool_index" in current context. Error occurred in Python: No symbol "pool_index" in current context. [1] https://lore.kernel.org/linux-mm/cover.1700502145.git.andreyknvl@google.com/ Link: https://lkml.kernel.org/r/20231129065142.13375-3-Kuan-Ying.Lee@mediatek.com Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Cc: Andrey Konovalov <andreyknvl@google.com> Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Cc: Chinwen Chang <chinwen.chang@mediatek.com> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Qun-Wei Lin <qun-wei.lin@mediatek.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-10scripts/spelling.txt: add more spellings to spelling.txtColin Ian King
Some of the more common spelling mistakes and typos that I've found while fixing up spelling mistakes in the kernel over the past couple of releases. Link: https://lkml.kernel.org/r/20231122104037.1770749-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-10checkstack: sort output by size and function nameHeiko Carstens
Sort output by size and in addition by function name. This increases readability for cases where there are many functions with the same stack usage. Link: https://lkml.kernel.org/r/20231120183719.2188479-3-hca@linux.ibm.com Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Cc: Maninder Singh <maninder1.s@samsung.com> Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Vaneet Narang <v.narang@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-10checkpatch: do not require an empty line before error injectionSergey Senozhatsky
ALLOW_ERROR_INJECTION macro (just like EXPORT_SYMBOL) can immediately follow a function it annotates. Link: https://lkml.kernel.org/r/20231109075147.2779461-1-senozhatsky@chromium.org Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> Acked-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@canonical.com> (maintainer:CHECKPATCH) Cc: Dwaipayan Ray <dwaipayanray1@gmail.com> (reviewer:CHECKPATCH) Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-10kconfig: factor out common code shared by mconf and nconfMasahiro Yamada
Separate out the duplicated code to mnconf-common.c. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-12-10modpost: remove unreachable code after fatal()Masahiro Yamada
Now compilers can recognize fatal() never returns. While GCC 4.5 dropped support for -Wunreachable-code, Clang is capable of detecting the unreachable code. $ make HOSTCC=clang HOSTCFLAGS=-Wunreachable-code-return [snip] HOSTCC scripts/mod/modpost.o scripts/mod/modpost.c:520:11: warning: 'return' will never be executed [-Wunreachable-code-return] return 0; ^ scripts/mod/modpost.c:477:10: warning: 'return' will never be executed [-Wunreachable-code-return] return 0; ^ 2 warnings generated. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
2023-12-10modpost: remove unneeded initializer in section_rel()Masahiro Yamada
This initializer was added to avoid -Wmaybe-uninitialized (gcc) and -Wsometimes-uninitialized (clang) warnings. Now that compilers recognize fatal() never returns, it is unneeded. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
2023-12-10modpost: inform compilers that fatal() never returnsMasahiro Yamada
The function fatal() never returns because modpost_log() calls exit(1) when LOG_FATAL is passed. Inform compilers of this fact so that unreachable code flow can be identified at compile time. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
2023-12-10modpost: move __attribute__((format(printf, 2, 3))) to modpost.hMasahiro Yamada
This attribute must be added to the function declaration in a header for comprehensive checking of all the callsites. Fixes: 6d9a89ea4b06 ("kbuild: declare the modpost error functions as printf like") Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
2023-12-10kbuild: determine base DTB by suffixMasahiro Yamada
When using the -dtbs syntax, you need to list the base first, as follows: foo-dtbs := foo_base.dtb foo_overlay1.dtbo foo_overlay2.dtbo dtb-y := foo.dtb You cannot do this arrangement: foo-dtbs := foo_overlay1.dtbo foo_overlay2.dtbo foo_base.dtb This restriction comes from $(firstword ...) in the current implementation, but it is unneeded to rely on the order in the -dtbs syntax. Instead, you can simply determine the base by the suffix because the base (*.dtb) and overlays (*.dtbo) use different suffixes. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
2023-12-10kbuild: deb-pkg: remove the fakeroot builds supportMasahiro Yamada
In 2017, the dpkg suite introduced the rootless builds support with the following commits: - 2436807c87b0 ("dpkg-deb: Add support for rootless builds") - fca1bfe84068 ("dpkg-buildpackage: Add support for rootless builds") This feature is available in the default dpkg on Debian 10 and Ubuntu 20.04. Remove the old method. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>