Skip to content

Isobus logformat updates - #636

Merged
olerem merged 2 commits into
linux-can:masterfrom
hartkopp:isobus-logformat
Oct 14, 2026
Merged

olerem merged 2 commits into
linux-can:masterfrom
hartkopp:isobus-logformat

Conversation

@hartkopp

Copy link
Copy Markdown
Member

just some missing cleanups and fixing from the LLM session

Several log messages used format specifiers which did not match the
types of the provided arguments (e.g. %d or %i for size_t/ssize_t,
%ld for int64_t/time_t and size_t for the '.*' precision). On 64 bit
hosts (and for int64_t/time_t on 32 bit hosts) this leads to wrong
output or undefined behaviour when the log level is enabled.

Additionally the seek response position was compared to the requested
offset without le32toh() conversion which fails on big endian hosts.

Fix the format specifiers and add the missing le32toh() conversion.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
All pr_*() log macros use isobusfs_log() which was declared without a
format attribute. Therefore the compiler did not check the format
strings against the provided arguments.

Add __attribute__((format(printf, 2, 3))) to let the compiler detect
mismatching format specifiers.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
@hartkopp
hartkopp requested a review from olerem October 14, 2026 17:27
@olerem
olerem merged commit 834ceef into linux-can:master Oct 14, 2026
10 of 12 checks passed
@olerem

olerem commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

LGTM. Thx!

@hartkopp
hartkopp deleted the isobus-logformat branch October 14, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants