Page MenuHomeFreeBSD

oce: Simplify probe method
Needs ReviewPublic

Authored by ryan_freqlabs.com on Mar 19 2019, 9:14 AM.

Details

Reviewers
jpaetzel
Summary
  • Use existing struct pci_device_table and related macros for device matching.
  • Put the relevant flags in the static array of supported devices, so we don't need to figure them out separately once we've matched a device.
  • Use snprintf instead of sprintf as an extra safeguard against memory corruption.

No change in functionality.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

imp added inline comments.Mar 19 2019, 2:58 PM
sys/dev/oce/oce_if.c
232–244

There's already a PCI structure defined for this: pci_device_table, though to be honest it's under documented.

ryan_freqlabs.com edited the summary of this revision. (Show Details)

Use existing struct pci_device_table and related macros as suggested by @imp

ryan_freqlabs.com marked an inline comment as done.Mar 22 2019, 12:06 AM