Linux kernel patches
-
[PATCH] dmaengine: idxd: Remove unused status variable in irq_process_work_list()
: Not a clang specific warning but it impacts builds where I use-Werror
, as kernel builds should be as warning clean as possible. -
[PATCH] ASoC: Intel: boards: Fix CONFIG_SND_SOC_SDW_MOCKUP select
: Not a clang specific warning but Kconfig warnings such as this can potentially be build errors later due to incorrect dependency selection so it is important to fix them when they pop up. -
[PATCH] scripts/recordmcount.pl: Remove check_objcopy() and $can_use_local
: The kernel has certain version checks in place that do not always work with LLVM tools due to different version outputs. This was an easy cleanup because the kernel checks for certain tool versions before building, which provides an airtight reason to remove other version checks for versions older than the mandatory one. -
[PATCH] netfilter: ipset: Fix maximal range check in hash_ipportnet4_uadt()
: A fix for a simple programming error but this was important to catch because the fixed patch was destined for the current merge window as it was in the netfilter tree, rather than netfilter-next tree, and it is a security patch. -
[PATCH] PCI: Always initialize dev in pciconfig_read
: Another small fix for an uninitialized variable warning. -
[PATCH] cpuidle: pseries: Mark pseries_idle_proble() as __init
|[PATCH] powerpc/xive: Do not mark xive_request_ipi() as __init
: The kernel marks certain functions as “init”, meaning that their memory is discarded once the kernel has fully loaded. As a result, the kernel has a tool that checks that all init functions are only called from other init functions and not functions that can run at any point. This commit fixes a warning that clang had because it did not inline a function like GCC did, which is a common reason for these warnings. Whether or not it is an actual issue in practice does not matter, it is important to clean these up to avoid spooky warnings. -
[PATCH 0/4] staging: r8188eu: Fix clang warnings
: A new version of another driver in the staging directory was introduced without being compiled with clang so this series cleans up the warnings that it found. Eventually, I hope that compiling with both compilers will become easy enough that everyone does it automatically but that is a long-term and lofty goal :) -
[PATCH] net: ethernet: stmmac: Do not use unreachable() in ipq806x_gmac_probe()
:objtool
is an object file validator for x86_64 (and maybe other architectures in the future), which warns when the assembly of a file might have potential issues, which may be compiler bugs. In this particular case, it was easy enough to just fix the code in question but this is most likely related to another open issue that we currently have. -
[PATCH] staging: r8188eu: os_dep: Hoist vmalloc.h include into osdep_service.h
: AnotherARCH=hexagon
build fix, which I have mentioned in previous posts is the only architecture in the tree that only compiles with LLVM, meaning we must keep it building. -
[PATCH] mm/hugetlb: Initialize page to NULL in alloc_buddy_huge_page_with_mpol()
: A common theme throughout all of these posts is fixing uninitialized variables, because Linus disabled GCC’s-Wmaybe-uninitialized
several releases ago because there are a lot of false positives due to GCC doing its analysis after inlining and optimization. Fun fact, I actually learned today that clang has a similar warning,-Wconditional-uninitialized
, which in my testing appears to be just as noisy as GCC’s, but it is off by default.-Wsometimes-uninitialized
was split off from it and added to-Wuninitialized
because it does not suffer from the same issues (“sometimes” is more definitive than “maybe”). -
[PATCH 0/3] staging: r8188eu: Fix -Wuninitialized instances from clang
:-Wuninitialized
(a common GCC/clang flag) was disabled for this new driver and someone enabled it without testing it withclang
so this series cleans up those warnings. -
[PATCH] drm/i915/selftest: Fix use of err in igt_reset_{fail, nop}_engine()
: Another-Wuninitialized
warning :^) -
[PATCH] iwlwifi: mvm: Fix bitwise vs logical operator in iwl_mvm_scan_fits()
|[PATCH] staging: rtl8192u: Fix bitwise vs logical operator in TranslateRxSignalStuff819xUsb()
|[PATCH] lib/zstd: Fix bitwise vs logical operators
: A proposed warning inclang
exposed a few instances where&
was used instead of&&
with boolean values. This is not always a bug but it is much clearer to use the logical operators because of short circuiting;b
will not be evaluated inif (a && b)
ifa
is false, whereas it will be inif (a & b)
, which caused a bug in ChromeOS. -
[PATCH] bus: ti-sysc: Add break in switch statement in sysc_init_soc()
|[PATCH] drm/radeon: Add break to switch statement in radeonfb_create_pinned_object()
|[PATCH] scsi: st: Add missing break in switch statement in st_ioctl()
: In the quest to enable-Wimplicit-fallthrough
, which is a little bit more pedantic with clang over GCC (a known difference which neither party is interested in changing), I sent a few patches to markcase
statements withbreak
. This version of the warning can find bugs so it is important to get it enabled so CI systems can start catching them. -
Re: Patch "vmlinux.lds.h: Handle clang's module.{c,d}tor sections" has been added to the 5.13-stable tree
: A stable backport for a commit that I submitted upstream so that Android and ChromeOS do not regress. -
[PATCH] fs/ntfs3: Remove unused variable cnt in ntfs_security_init()
: A simple clean up of a variable that was unused. -
[PATCH 1/3] kbuild: Remove -Wno-format-invalid-specifier from clang block
: Clean up of our clang warning section in the main Makefile, which is important for future travelers. -
[PATCH] kbuild: Switch to 'f' variants of integrated assembler flag
: A small clean up of the flags used for the integrated assembler, as it has been brought up a few times in various code reviews. -
[PATCH] f2fs: Add missing inline to f2fs_sanity_check_cluster() stub
: The kernel usesinline
on stubs to avoid unused function warnings; this patch adds one that was missing. -
[PATCH 1/2] ALSA: hda/sigmatel - Sink stac_shutup() into stac_suspend()
:CONFIG_PM=n
builds are not often tested, which can cause warnings with suspend and resume functions. This was uncovered on s390, which removed support forCONFIG_PM
. -
[PATCH] rtlwifi: rtl8192de: Fix initialization of place in _rtl92c_phy_get_rightchnlplace()
-
[PATCH 0/2] Harden clang against unknown flag options
: There are some optimization flags that GCC has which clang does not implement and it issues a warning about that. When these flags are added to the compiler flags unconditionally, it causes allcc-option
andcc-disable-warning
calls (which test support for compiler flags) to fail, meaning that certain warnings or options do not get enabled/disabled, annoying developers. This series resolves the particular instance that Intel’s Oday bot ran across in randconfig testing and makes sure that we catch these issues quicker in the future. -
[PATCH] cxgb4: Properly revert VPD changes
: A botched revert introduced some uninitialized variables so this commit resets the file properly. -
[PATCH 0/3] drm/i915: Enable -Wsometimes-uninitialized
:-Wuninitialized
and-Wsometimes-uninitialized
were disabled separately for i915 (because it enables-Wall -Wextra
to help catch bugs), even though the latter is a sub-warning of the former (meaning that if-Wuninitialized
is disabled, so is-Wsometimes-uninitialized
). This series cleans up some instances of the warning then enables it again so that i915 gets coverage like the rest of the kernel. -
[PATCH] drm/i915: Clean up disabled warnings
: This patch came about from my investigation of the optimization flag issue that I mentioned above. This helps avoid the warnings because we eliminate a fewcc-disable-warning
calls. -
[PATCH] cxl/core: Avoid using dev uninitialized in devm_cxl_add_decoder()
-
[PATCH] crypto: sm4 - Do not change section of ck and sbox
: A warning from GNU as that only appears when compiling with clang. Subtle but important to get right. -
[PATCH 1/3] MAINTAINERS: Update ClangBuiltLinux mailing list
: We moved mailing lists so that we get archival along with the rest of the kernel through lore.kernel.org and we no longer have to deal with spam ourselves. -
[PATCH] x86/setup: Explicitly include acpi.h
: A build error that was introduced during the merge window, which is unfortunate because that is what linux-next is for.
LLVM patches
[clang] Expose unreachable fallthrough annotation warning
: The commit message is fairly self explanatory; this is necessary to enable clang’s-Wimplicit-fallthrough
.
Patch review and input
For the next sections, I link directly to my first response in the thread when possible but there are times where the link is to the main post. My responses can be seen inline by going to the bottom of the thread and clicking on my name.
Reviewing patches that are submitted is incredibly important, as it helps ensure good code quality due to catching mistakes before the patches get accepted and it can help get patches accepted faster, as some maintainers will blindly pick up patches that have been reviewed by someone that they trust.
-
Re: [PATCH 3/3] isystem: delete global -isystem compile option
-
Re: [PATCH v6 3/3] Documentation/llvm: update CROSS_COMPILE inferencing
-
Re: [PATCH v2] compiler_attributes.h: move __compiletime_{error|warning}
-
Re: [PATCH] slub: fix kmalloc_pagealloc_invalid_free unit test
-
LLVM build of RISCV kernel fails with relocation R_RISCV_PCREL_HI20 out of range
-
Re: [PATCH v3] riscv: explicitly use symbol offsets for VDSO
-
Re: [PATCH] kbuild: check CONFIG_AS_IS_LLVM instead of LLVM_IAS
-
Re: [PATCH v2] scripts/Makefile.clang: default to LLVM_IAS=1
-
Re: [PATCH v2] clang-tools: Print information when clang-tidy tool is missing
-
[Clang] Extend -Wbool-operation to warn about bitwise and of bools with side effects
-
Re: [PATCH] kbuild: Fix 'no symbols' warning when CONFIG_TRIM_UNUSD_KSYMS=y
-
Re: [PATCH v2 1/7] Compiler Attributes: Add __alloc_size() for better bounds checking
-
Re: [PATCH][next] fs/ntfs3: Fix fall-through warnings for Clang
-
Re: [PATCH][next] staging: r8188eu: Fix fall-through warnings for Clang
-
Re: [GIT PULL] Enable -Wimplicit-fallthrough for Clang for 5.14-rc7
-
Re: [PATCH v3 0/5] Enable -Warray-bounds and -Wzero-length-bounds
-
Re: [PATCH] powerpc/bug: Cast to unsigned long before passing to inline asm
Issue triage and reporting
The unfortunate thing about working at the intersection of two projects is we will often find bugs that are not strictly related to the project, which require some triage and reporting back to the original author of the breakage so that they can be fixed and not impact our own testing. Some of these bugs fall into that category while others are issues strictly related to this project.
-
Re: [block:io_uring-fops.v6 58/64] io_uring.c:undefined reference to
__compiletime_assert_833’` -
Re: [PATCH] mm/mempolicy: fix a race between offset_il_node and mpol_rebind_task
-
Fedora i686 config "traps: PANIC: double fault, error_code: 0x0" in test_atomic64()
-
ERROR: modpost: "__mulodi4" [drivers/block/nbd.ko] undefined!
-
[CVP] processSwitch: Remove default case when switch cover all possible values.
-
Re: [linux-next:master 6632/9522] include/linux/pm_opp.h:458:58: warning: unused parameter 'dev'
-
objtool warning in cfg80211_edmg_chandef_valid() with ThinLTO
-
Re: [PATCH v2 2/2] powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto
-
Fedora i686 config minus CONFIG_FORTIFY_SOURCE error in arch/x86/include/asm/checksum_32.h
-
Re: [PATCH v4 4/4] powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP
-
-Warray-bounds warning with asm goto in impossible switch cases
-
Re: [PATCH v5 17/31] target/arm: Enforce alignment for LDM/STM
Tooling improvements
Behind the scenes
- Every day that there is a new linux-next release, I rebase and build a few different kernel trees then boot and runtime test them on several different machines, including a Raspberry Pi 3 and 4, HP desktop, ASUS laptop, and Hyper-V and VMware platforms on my workstation. This is not always visible because I do not report anything unless there is something broken but it can take up to a few hours each day, depending on the amount of churn and issues uncovered.
Special thanks to:
- Google and the Linux Foundation for sponsoring my work.