Page MenuHomeFreeBSD

pciconf: Minor cleanups in the config register methods
ClosedPublic

Authored by jhb on Wed, Jun 10, 8:36 PM.
Tags
None
Referenced Files
F160468523: D57535.id179585.diff
Wed, Jun 24, 7:57 PM
F160412685: D57535.id179585.diff
Wed, Jun 24, 6:10 AM
Unknown Object (File)
Tue, Jun 23, 8:39 AM
Unknown Object (File)
Sat, Jun 20, 10:09 AM
Unknown Object (File)
Wed, Jun 17, 2:04 PM
Unknown Object (File)
Wed, Jun 17, 2:04 PM
Unknown Object (File)
Wed, Jun 17, 12:54 AM
Unknown Object (File)
Wed, Jun 17, 12:39 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.Wed, Jun 10, 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.