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)
Fri, Sep 26, 8:39 AM
Unknown Object (File)
Mon, Sep 22, 6:21 AM
Unknown Object (File)
Fri, Sep 19, 10:54 AM
Unknown Object (File)
Thu, Sep 18, 8:44 PM
Unknown Object (File)
Sat, Sep 13, 6:41 AM
Unknown Object (File)
Sat, Sep 13, 5:06 AM
Unknown Object (File)
Aug 25 2025, 9:36 PM
Unknown Object (File)
Aug 11 2025, 6:06 AM

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 Passed
Unit
No Test Coverage
Build Status
Buildable 63282
Build 60166: arc lint + arc unit

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.