Repository navigation
Apple drivers: allmodconfig sparse/W=1 warnings and checkpatch whitespace errors (no code change) - #2834
Open
RyanTheTide wants to merge 6 commits into
Open
Apple drivers: allmodconfig sparse/W=1 warnings and checkpatch whitespace errors (no code change)#2834RyanTheTide wants to merge 6 commits into
RyanTheTide wants to merge 6 commits into
Conversation
…se types sparse (C=1, allmodconfig) reports four "cast to restricted __le16" and three "restricted pci_power_t degrades to integer" warnings here: - The IPC send and hello paths poll a little-endian ring index with READ_ONCE() into a u16 and then pass that to le16_to_cpu(). Declare the local as __le16, which is what it holds. The conversion and the comparison are unchanged. - PCI_D0 and PCI_D3hot are pci_power_t (__bitwise). Writing them into PCI_PM_CTRL needs a __force u16 cast, as drivers/pci/pci.c does. No functional change: the generated code is identical. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
apple_dart_host_lock() and apple_dart_host_unlock() live in apple-dart-dcp.h, but their only callers in apple-dart.c sit under CONFIG_APPLE_DART_J713_DCP. Any build without that option (APPLE_DART=m, 4K pages, allmodconfig) gets two -Wunused-function warnings. Mark them __maybe_unused. static inline would also silence the warning, but it changes clang's inlining in apple-dart.o; __maybe_unused leaves the generated code identical with CONFIG_APPLE_DART_J713_DCP=y. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
sparse warns "dubious: !x | y" on the DP lane mask. dp_lane[] is bool, so the double negation does nothing; drop it. The generated code is identical. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On LSR variants push_address() pushes (addr >> 8) as a u32. When a KUnit test passes a constant DMA address above 40 bits, sparse reports "cast truncates bits from constant value". Only the low 32 bits of (addr >> 8) go into the instruction word, so the truncation is intended. Say so with lower_32_bits(). The generated code is identical. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Fix the checkpatch --strict ERRORs in drivers/gpu/drm/apple that are
whitespace only and that no open pull request touches:
- CODE_INDENT: indent with tabs (afk.h, audio.c, connector.c, dptxep.c,
iomfb_internal.h, plane.c).
- ELSE_AFTER_BRACE: "} else {" in parser.c, with braces on both
branches.
- SPACING: remove the inner spaces in DCP_FW_VERSION().
The generated code is identical. Files with many open PRs against them
(dcp.c, dcp-internal.h, iomfb.c, iomfb_template.c, apple_drv.c,
dcp-fabric.c) are left for later to avoid conflicts.
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Fix the whitespace-only checkpatch --strict ERRORs and LEADING_SPACE warnings in: - avd-av1-entropymode.c: indent the CDF tables with tabs, drop the spaces inside the array bounds of the table declarations, and write one cast as "(type *)". - avd.h: "const char *fw_name". - soc/apple dockchannel.c, shim.h and mailbox-g17-test.h: indent with tabs. The generated code is identical. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
4 of 17 tasks
Contributor
Author
|
Review at 537b04f. I went through the whole diff, including with whitespace ignored, looking for anything that changes semantics. Nothing does.
The size is fine (19 files, +75/-74, six commits split by subsystem). It does not need splitting. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The first code-health pass (#2827) only built what the fleet config enables. An arm64 allmodconfig build (COMPILE_TEST, 4K pages) with W=1 and sparse over the Apple driver dirs turns up a few more warnings in code the fleet build never compiles that way:
apple-dart-dcp.h:apple_dart_host_lock()/apple_dart_host_unlock()raise-Wunused-functionin every build withoutCONFIG_APPLE_DART_J713_DCP(APPLE_DART=m, 4K pages).__le16into au16, andPCI_D0/PCI_D3hotare written intoPCI_PM_CTRLwithout a__forcecast (7 sparse warnings).!!a | (!!b << 1)on bools as "dubious: !x | y".There are also 166 checkpatch
--strictERRORs in the original scope. Most are whitespace.Change
Six commits, none of which should change behaviour:
__le16 tail,(__force u16)PCI_D*.__maybe_unusedon the two host-lock helpers.static inlinealso silences the warning, but it changed clang's inlining in apple-dart.o, so it isn't used.!!on bool lane flags.lower_32_bits()for the LSR address word.} else {, and paren spacing inDCP_FW_VERSION().const char */(type *)spacing.The whitespace commits only touch lines that no open PR edits (checked against the hunks of every open PR, within 4 lines). Files that 10 or more open PRs touch are left alone.
Testing
llvm-objdump -dtext andllvm-nm -Sfunction sizes in two configs: fleet79 (16K, J713 DCP on, 230/230 objects) and arm64 allmodconfig (253/253 objects).--strictERRORs in the 19 touched files go from 101 to 52. What is left: AOM_CDF initializer-list macros (false positives), lines that open PRs touch, and one COMPLEX_MACRO.--stricton each patch: 0 errors. There is one warning (kzalloc_obj), and it is on a line this PR only re-indents.Still to run
CI. No hardware rows are needed because the object code is identical.
Reviewer detail
DRM_ASAHIis still off because it needs 16K pages, and the fleet config covers it.llvm-objdump -d --no-show-raw-insn --no-leading-addr, with.Ltmplabels and section headers dropped. The size table is every t/T symbol fromllvm-nm -S --defined-only.macaudio.c: about 28 platform cfgs and 2 DAPM enums are not static. Open speaker PRs edit those lines.usb-t6050/apple_t6050_usb_phy.h: "plain integer as NULL pointer" x99. The file is generated, so the fix belongs in the generator.dcp_backlight_test.c: adiv_u64"division by zero", which is a sparse false positive.unreachable_pubitems areextern "C"KUnit FFI exports, so their owners should decide.Assisted-by: LLM (Claude:Opus 5.5)