Page MenuHomeFreeBSD

pciconf: Minor cleanups in the config register methods
Needs ReviewPublic

Authored by jhb on Wed, Jun 10, 8:36 PM.
Tags
None
Referenced Files
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
Unknown Object (File)
Tue, Jun 16, 10:50 AM
Unknown Object (File)
Mon, Jun 15, 11:37 PM
Unknown Object (File)
Mon, Jun 15, 7:00 PM
Subscribers
None

Details

Reviewers
imp
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