Page MenuHomeFreeBSD

Kernel: Consistently use `device_t`
ClosedPublic

Authored by dumbbell on Aug 8 2016, 11:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Mar 20, 2:10 PM
Unknown Object (File)
Tue, Mar 12, 4:10 PM
Unknown Object (File)
Feb 22 2024, 11:23 PM
Unknown Object (File)
Feb 22 2024, 11:23 PM
Unknown Object (File)
Jan 6 2024, 12:22 PM
Unknown Object (File)
Dec 23 2023, 2:19 AM
Unknown Object (File)
Nov 10 2023, 3:17 PM
Unknown Object (File)
Nov 8 2023, 10:01 AM
Subscribers

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
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4731
Build 4785: arc lint + arc unit

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

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

sys/mips/nlm/dev/net/xlpge.c
178–179

whitespace issue

sys/mips/rmi/dev/nlge/if_nlge.c
143–144

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.