Page MenuHomeFreeBSD

Kernel: Consistently use `device_t`
ClosedPublic

Authored by dumbbell on Aug 8 2016, 11:21 PM.

Details

Summary

Several files use the internal name of struct device instead of device_t which is part of the public API. This patch changes all struct device * to device_t.

The remaining occurrences of struct device are those referring to the Linux or OpenBSD version of the structure, or the code is not built on FreeBSD and it's unclear what to do.

This patch was initially created by Kip Macy and is part of D6585. It was extracted and modified so it can be committed separately from the possible rename of FreeBSD's struct device.

FWIW, the following command was used to find all occurrences:

git grep -E 'struct +device[[:>:]]'
Test Plan

The patch survived a make universe UNIVERSE_TARGET=buildkernel and two MIPS buildkernels (XLP and XLR) because they do not have a GENERIC kernel to make make universe happy; the same problem exists for ARM but the patch doesn't touch anything ARM-specific.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

dumbbell retitled this revision from to Kernel: Consistently use `device_t`.
dumbbell updated this object.
dumbbell edited the test plan for this revision. (Show Details)
dumbbell added reviewers: emaste, scottl.
dumbbell edited the test plan for this revision. (Show Details)
dumbbell edited edge metadata.
dumbbell updated this object.
jhibbits edited edge metadata.
This revision is now accepted and ready to land.Aug 9 2016, 2:46 PM
sbruno edited edge metadata.

for Intel device drivers, this is fine.

Some minor comments, also we should send a note to upstreams for the sys/contrib changes.

sys/boot/kshim/bsd_kernel.h
357 ↗(On Diff #19143)

This one seems to be a slightly different case, and should probably be handled separately.

sys/mips/nlm/dev/net/xlpge.c
178–179 ↗(On Diff #19143)

whitespace issue

sys/mips/rmi/dev/nlge/if_nlge.c
143–144 ↗(On Diff #19143)

whitespace

dumbbell edited edge metadata.

Address @emaste comments

  • Do not touch sys/boot/kshim/bsd_kernel.h in this round.
  • Remove useless whitespaces in sys/mips/nlm/dev/net/xlpge.c and sys/mips/rmi/dev/nlge/if_nlge.c.
This revision now requires review to proceed.Aug 9 2016, 5:33 PM
emaste edited edge metadata.
This revision is now accepted and ready to land.Aug 9 2016, 6:05 PM
This revision was automatically updated to reflect the committed changes.