Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Details
- Reviewers
markj emaste imp - Commits
- rG4e8eb778803a: sound: Clean up midi/ includes
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 68764 Build 65647: arc lint + arc unit
Event Timeline
| sys/dev/sound/midi/midi.c | ||
|---|---|---|
| 35 | style(9) calls for sys/types.h first Kernel include files (sys/*.h) come first. If either <sys/types.h> or <sys/param.h> is needed, include it before other include files. (<sys/param.h> includes <sys/types.h>; do not include both.) Next, include <sys/systm.h>, if needed. The remaining kernel headers should be sorted alphabetically. | |
| sys/dev/sound/midi/midi.h | ||
| 32 | Do we not want this for uint8_t? | |
- Bring back sys/types.h in midi.h.
- Do not include sys/types.h where sys/param.h is included.
- Sort includes alphabetically after sys/param.h and sys/systm.h.
| sys/dev/sound/midi/midi.h | ||
|---|---|---|
| 32 | Compiler didn't complain, but I'll include it to be safe. | |
| sys/dev/sound/midi/midi.c | ||
|---|---|---|
| 38 | See mutex.9: mutex.h requires lock.h to be included first. Otherwise you're relying on some other header implicitly bringing it in for you, which is fragile and sometimes breaks. Per what I wrote above, someday we should ensure that mutex.h is self-contained, but in the meantime we should follow the documented include protocol. | |
| sys/dev/sound/midi/midi.h | ||
| 32 | "The compiler doesn't complain" isn't a good test in general. You're basically requiring that every file which includes midi.h also include types.h first. In the past few years we've been trying to move away from that kind of thing, at least for userspace headers. That is, headers should be self-contained when possible. This is less important for kernel-only headers such as this one, but still there's no reason to remove the types.h include. | |
| sys/dev/sound/midi/midi.c | ||
|---|---|---|
| 38 | Yeah, I brought it back earlier, but didn't update the diff. It did cause a compilation error at some point. | |