Page MenuHomeFreeBSD

pciconf: Minor cleanups in the config register methods
ClosedPublic

Authored by jhb on Jun 10 2026, 8:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jul 15, 6:54 PM
Unknown Object (File)
Wed, Jul 15, 7:48 AM
Unknown Object (File)
Wed, Jul 15, 7:25 AM
Unknown Object (File)
Wed, Jul 15, 7:25 AM
Unknown Object (File)
Tue, Jul 7, 4:10 PM
Unknown Object (File)
Mon, Jul 6, 11:06 AM
Unknown Object (File)
Fri, Jul 3, 11:52 PM
Unknown Object (File)
Tue, Jun 30, 11:04 AM
Subscribers
None

Details

Summary

This is mostly to provide cleaner code for future changes to copy from
as other changes are already copying somewhat dubious existing
patterns in these routines.

  • Use NULL instead of casting 0 to pointer types.
  • Inline readone() in the sole caller now that it is just a single line.
  • Use a helper variable for the count of items on each line of output in readit().
  • Fix the double space in the middle of byte output to only trigger for width 1. For other widths it would output spurious spaces at the end of the line which doesn't really hurt, but is buggy nonetheless.
  • Avoid using implicit booleans by explicitly comparing integer expressions against zero.
  • Don't compare the endptr returned from strtol() against NULL.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 73813
Build 70696: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Jun 10 2026, 8:36 PM
jhb created this revision.
This revision was not accepted when it landed; it landed in state Needs Review.Tue, Jun 23, 3:52 PM
This revision was automatically updated to reflect the committed changes.