aboutsummaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2024-01-04scripts/tags.sh: use -n to test archincludeWei Yang1-1/+1
In bash, "! -z" is equivalent to "-n", which seems to be more intuitive. Signed-off-by: Wei Yang <[email protected]> CC: Sam Ravnborg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2024-01-04scripts/tags.sh: add local annotationWei Yang1-2/+2
Commit 'f81b1be40c44 tags: include headers before source files' introduce two local variables. Let's add local annotation to make it obvious. Signed-off-by: Wei Yang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2024-01-04scripts/tags.sh: use more portable -path instead of -wholenameWei Yang1-1/+1
According to the manual, -path is more portable than -wholename. Also for consistency, let's use -path here. Signed-off-by: Wei Yang <[email protected]> CC: Guennadi Liakhovetski <[email protected]> CC: WANG Cong <[email protected]> CC: Michal Marek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2024-01-04scripts/tags.sh: Update comment (addition of gtags)René Nyffenegger1-1/+1
Commit f4ed1009fcea ("kbuild: add GNU GLOBAL tags generation") added support for the GNU Global source tagging system. However, this addition was not reflected in the script's header comment. Fixes: f4ed1009fcea ("kbuild: add GNU GLOBAL tags generation") Signed-off-by: René Nyffenegger <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2024-01-03kernel-doc: handle a void function without producing a warningRandy Dunlap1-0/+1
Currently a void function can produce a warning: main.c:469: warning: contents before sections This one is from arch/x86/kernel/cpu/sgx/main.c (which is not included in any produced kernel documentation output). Handle this by setting $in_doc_sect to 1 whenever any recognized document section name is processed. Fixes: f624adef3d0b ("kernel-doc: limit the "section header:" detection to a select few") Signed-off-by: Randy Dunlap <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: [email protected] Signed-off-by: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2024-01-03scripts/get_abi.pl: ignore some temp filesRandy Dunlap1-0/+1
When there are filenames of the form ".orig" or ".rej" in the Documenatation/ABI/ subdirectories, there can be confusing or erroneous output generated. Example: the file Documenation/ABI/testing/sysfs-bus-papr-pmem.orig causes this warning message: Documentation/ABI/testing/sysfs-bus-papr-pmem:2: WARNING: unknown document: '/powerpc/papr_hcalls' Prevent this by skipping over filenames that may be created by patch/diff tools etc. Signed-off-by: Randy Dunlap <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: [email protected] Acked-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2024-01-03scripts/get_abi: fix source path leakVegard Nossum1-1/+1
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 <[email protected]> Cc: [email protected] Signed-off-by: Vegard Nossum <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2023-12-31get_maintainer: remove stray punctuation when cleaning file emailsAlvin Šipraga1-7/+11
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: - [email protected] This would previously be processed by get_maintainer.pl as: - <[email protected]> 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: [email protected] Some additional comments are added to the function to make things clearer to future readers. Link: https://lore.kernel.org/all/[email protected]/ Suggested-by: Joe Perches <[email protected]> Signed-off-by: Alvin Šipraga <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2023-12-31get_maintainer: correctly parse UTF-8 encoded names in filesAlvin Šipraga1-13/+17
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 <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2023-12-29scripts/decode_stacktrace.sh: strip unexpected CR from linesBjorn Andersson1-0/+3
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/[email protected] Signed-off-by: Bjorn Andersson <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-12-29scripts/checkstack.pl: fix no space expression between sp and offsetKuan-Ying Lee1-1/+1
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/[email protected] Signed-off-by: Kuan-Ying Lee <[email protected]> Cc: Casper Li <[email protected]> Cc: AngeloGioacchino Del Regno <[email protected]> Cc: Chinwen Chang <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Qun-Wei Lin <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-12-29scripts/checkstack.pl: change min_stack to 512 by defaultTiezhu Yang1-1/+1
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/[email protected] Signed-off-by: Tiezhu Yang <[email protected]> Cc: Jonathan Corbet <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-12-29scripts/checkstack.pl: match all stack sizes for some archsTiezhu Yang1-6/+6
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/[email protected] Signed-off-by: Tiezhu Yang <[email protected]> Cc: Jonathan Corbet <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-12-29scripts/checkstack.pl: add min_stack to the usage commentTiezhu Yang1-1/+1
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/[email protected] Signed-off-by: Tiezhu Yang <[email protected]> Cc: Jonathan Corbet <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-12-29scripts/checkstack.pl: remove ia64 supportTiezhu Yang1-4/+0
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/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Tiezhu Yang <[email protected]> Cc: Jonathan Corbet <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-12-29checkstack: add loongarch support for scripts/checkstack.plYouling Tang1-0/+4
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 <[email protected]> Acked-by: Huacai Chen <[email protected]> Cc: John Paul Adrian Glaubitz <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-12-29scripts/decodecode: add support for LoongArchYouling Tang1-0/+5
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 <[email protected]> Acked-by: Huacai Chen <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-12-29kbuild: deb-pkg: squash scripts/package/deb-build-option to debian/rulesMasahiro Yamada2-16/+3
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 <[email protected]> Reviewed-by: Nicolas Schier <[email protected]>
2023-12-29kbuild: deb-pkg: factor out common Make options in debian/rulesMasahiro Yamada1-4/+4
This avoids code duplication between binary-arch and built-arch. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nicolas Schier <[email protected]>
2023-12-29kbuild: deb-pkg: hard-code Build-DependsMasahiro Yamada1-3/+2
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 <[email protected]> Reviewed-by: Nicolas Schier <[email protected]>
2023-12-29kbuild: deb-pkg: split debian/copyright from the mkdebian scriptMasahiro Yamada2-20/+17
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 <[email protected]> Reviewed-by: Nicolas Schier <[email protected]>
2023-12-29check-uapi: Introduce check-uapi.shJohn Moon1-0/+573
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 <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
2023-12-29scripts: Introduce a default git.orderFileLeonardo Bras1-0/+42
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 <[email protected]> Acked-by: Randy Dunlap <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
2023-12-29kconfig: WERROR unmet symbol dependencySergey Senozhatsky4-5/+25
When KCONFIG_WERROR env variable is set treat unmet direct symbol dependency as a terminal condition (error). Suggested-by: Stefan Reinauer <[email protected]> Signed-off-by: Sergey Senozhatsky <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
2023-12-28Merge tag 'kbuild-fixes-v6.7-2' of ↵Linus Torvalds2-4/+4
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-Pargmann1-1/+1
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 <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
2023-12-28kconfig: remove redundant NULL pointer check before free()Masahiro Yamada2-4/+2
Passing NULL to free() is allowed and is a no-op. Remove redundant NULL pointer checks. Signed-off-by: Masahiro Yamada <[email protected]>
2023-12-28kconfig: remove unreachable printf()Masahiro Yamada1-1/+0
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 <[email protected]>
2023-12-28kconfig: add include guard to lkc_proto.hMasahiro Yamada1-0/+5
Signed-off-by: Masahiro Yamada <[email protected]>
2023-12-28kconfig: squash menu_has_help() and menu_get_help()Masahiro Yamada2-17/+2
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 <[email protected]>
2023-12-23kbuild: fix build ID symlinks to installed debug VDSO filesMasahiro Yamada1-1/+1
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 <[email protected]>
2023-12-23gen_compile_commands.py: fix path resolve with symlinks in itJialu Xu1-3/+3
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 <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
2023-12-21rust: upgrade to Rust 1.74.1Miguel Ojeda1-1/+1
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 <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Reviewed-by: Benno Lossin <[email protected]> Tested-by: David Gow <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
2023-12-20Makefile.extrawarn: turn on missing-prototypes globallyArnd Bergmann1-2/+2
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/[email protected] Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Kees Cook <[email protected]> Acked-by: Palmer Dabbelt <[email protected]> # RISC-V Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Matt Turner <[email protected]> Cc: Dinh Nguyen <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Cc: Yoshinori Sato <[email protected]> Cc: Rich Felker <[email protected]> Cc: John Paul Adrian Glaubitz <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Nicolas Schier <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Stephen Rothwell <[email protected]> Cc: Tudor Ambarus <[email protected]> Cc: Zhihao Cheng <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-12-20Merge tag 'iio-for-6.8a' of ↵Greg Kroah-Hartman1-0/+1
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 Shevchenko1-2/+2
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 <[email protected]> Reviewed-by: Randy Dunlap <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2023-12-18docs: ignore __counted_by attribute in structure definitionsJonathan Corbet1-0/+1
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 <[email protected]>
2023-12-17scripts: checkpatch: Add __aligned to the list of attribute notesMarcelo Schmitt1-0/+1
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 <[email protected]> Acked-by: Joe Perches <[email protected]> Link: https://lore.kernel.org/r/1c5c93ecbd8c46a338b22a4ef52e51648e333c01.1702746240.git.marcelo.schmitt1@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2023-12-15scripts: kernel-doc: Clarify missing struct member descriptionKees Cook1-1/+1
The output "or member" should be more specific, instead saying "struct member". Cc: Jonathan Corbet <[email protected]> Cc: [email protected] Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2023-12-15scripts/kernel-doc: restore warning for Excess struct/unionRandy Dunlap1-0/+7
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 <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Cc: Mauro Carvalho Chehab <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: [email protected] Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2023-12-15docs: Raise the minimum Sphinx requirement to 2.4.4Jonathan Corbet1-9/+1
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Corbet <[email protected]>
2023-12-14Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski4-31/+23
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/[email protected]/ 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/[email protected]/ 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/[email protected]/ 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/[email protected]/ No adjacent changes. Signed-off-by: Jakub Kicinski <[email protected]>
2023-12-14rust: Suppress searching builtin sysrootMatthew Maurer1-0/+1
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 <[email protected]> Tested-by: Boqun Feng <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Link: https://lore.kernel.org/rust-for-linux/[email protected]/ [1] Link: https://lore.kernel.org/rust-for-linux/CAGSQo01pOixiPXkW867h4vPUaAjtKtHGKhkV-rpifJvKxAf4Ww@mail.gmail.com/ [2] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
2023-12-13sign-file: Fix incorrect return values checkYusong Gao1-6/+6
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 <[email protected]> Reviewed-by: Juerg Haefliger <[email protected]> Signed-off-by: David Howells <[email protected]> Link: https://lore.kernel.org/r/[email protected]/ # v5 Signed-off-by: Linus Torvalds <[email protected]>
2023-12-10scripts/gdb: remove exception handling and refine print formatKuan-Ying Lee2-35/+26
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/[email protected] Signed-off-by: Kuan-Ying Lee <[email protected]> Cc: Andrey Konovalov <[email protected]> Cc: AngeloGioacchino Del Regno <[email protected]> Cc: Chinwen Chang <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Qun-Wei Lin <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-12-10scripts/gdb/stackdepot: rename pool_index to pools_numKuan-Ying Lee1-3/+3
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/[email protected]/ Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Kuan-Ying Lee <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Cc: Andrey Konovalov <[email protected]> Cc: AngeloGioacchino Del Regno <[email protected]> Cc: Chinwen Chang <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Qun-Wei Lin <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-12-10scripts/spelling.txt: add more spellings to spelling.txtColin Ian King1-0/+14
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/[email protected] Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-12-10checkstack: sort output by size and function nameHeiko Carstens1-2/+17
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/[email protected] Signed-off-by: Heiko Carstens <[email protected]> Cc: Maninder Singh <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Vaneet Narang <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-12-10checkpatch: do not require an empty line before error injectionSergey Senozhatsky1-1/+1
ALLOW_ERROR_INJECTION macro (just like EXPORT_SYMBOL) can immediately follow a function it annotates. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Sergey Senozhatsky <[email protected]> Acked-by: Joe Perches <[email protected]> Cc: Andy Whitcroft <[email protected]> (maintainer:CHECKPATCH) Cc: Dwaipayan Ray <[email protected]> (reviewer:CHECKPATCH) Cc: Lukas Bulwahn <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-12-10kconfig: factor out common code shared by mconf and nconfMasahiro Yamada5-107/+75
Separate out the duplicated code to mnconf-common.c. Signed-off-by: Masahiro Yamada <[email protected]>