Page MenuHomeFreeBSD

LinuxKPI: add seq_hex_dump()
ClosedPublic

Authored by bz on Apr 2 2025, 6:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Feb 19, 12:13 PM
Unknown Object (File)
Wed, Feb 18, 2:07 PM
Unknown Object (File)
Tue, Feb 17, 6:31 PM
Unknown Object (File)
Jan 21 2026, 2:29 AM
Unknown Object (File)
Jan 20 2026, 6:13 PM
Unknown Object (File)
Jan 18 2026, 7:15 PM
Unknown Object (File)
Jan 17 2026, 1:14 PM
Unknown Object (File)
Jan 14 2026, 2:49 PM

Details

Summary

Move the implementation of print_hex_dump() into linux_compat.c as
lkpi_hex_dump() taking an extra function pointer and argument.
Add two internal wrappers for printf and sbuf_printf to get a common
function definition (sbuf_printf takes the extra argument).

Use these to implement print_hex_dump() and the newly added
seq_hex_dump().

This allows us to re-use the same implementation of print_hex_dump()
for both functions without duplicating the code.

Initial implementation: D49381 by dumbbell
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Test Plan

Entirely untested!

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested review of this revision.Apr 2 2025, 6:13 PM

Given this got automatic subscribers: this is up for discussion as an alternative to D49381 as I didn't like duplicating what looks like slightly weird code to me.

bz edited the test plan for this revision. (Show Details)

Also make compile with drm-kmod 6.1-lts.

I like this alternative, as you avoid code duplication. I will abandon my patch.

This revision is now accepted and ready to land.Apr 12 2025, 8:40 AM
This revision was automatically updated to reflect the committed changes.