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, Nov 13, 12:38 PM
Unknown Object (File)
Thu, Nov 13, 1:31 AM
Unknown Object (File)
Thu, Nov 13, 12:31 AM
Unknown Object (File)
Thu, Nov 13, 12:17 AM
Unknown Object (File)
Wed, Nov 12, 6:48 PM
Unknown Object (File)
Oct 26 2025, 6:11 PM
Unknown Object (File)
Oct 25 2025, 6:34 AM
Unknown Object (File)
Oct 25 2025, 12:11 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 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.