Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/sound/midi/midi.c
| Show All 26 Lines | |||||
| * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||||
| * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||||
| * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||||
| * POSSIBILITY OF SUCH DAMAGE. | * POSSIBILITY OF SUCH DAMAGE. | ||||
| */ | */ | ||||
| #include <sys/param.h> | #include <sys/param.h> | ||||
| #include <sys/systm.h> | #include <sys/systm.h> | ||||
| #include <sys/queue.h> | #include <sys/conf.h> | ||||
| #include <sys/fcntl.h> | |||||
emaste: style(9) calls for sys/types.h first
```
Kernel include files (sys/*.h) come first. If… | |||||
| #include <sys/kernel.h> | #include <sys/kernel.h> | ||||
| #include <sys/kobj.h> | |||||
| #include <sys/lock.h> | #include <sys/lock.h> | ||||
| #include <sys/module.h> | |||||
| #include <sys/mutex.h> | #include <sys/mutex.h> | ||||
| #include <sys/proc.h> | #include <sys/poll.h> | ||||
Not Done Inline ActionsSee 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. markj: See mutex.9: mutex.h requires lock.h to be included first. Otherwise you're relying on some… | |||||
Done Inline ActionsYeah, I brought it back earlier, but didn't update the diff. It did cause a compilation error at some point. christos: Yeah, I brought it back earlier, but didn't update the diff. It did cause a compilation error… | |||||
| #include <sys/signalvar.h> | #include <sys/queue.h> | ||||
| #include <sys/conf.h> | |||||
| #include <sys/selinfo.h> | #include <sys/selinfo.h> | ||||
| #include <sys/sysctl.h> | |||||
| #include <sys/malloc.h> | |||||
| #include <sys/sx.h> | #include <sys/sx.h> | ||||
| #include <sys/proc.h> | #include <sys/sysctl.h> | ||||
| #include <sys/fcntl.h> | |||||
| #include <sys/types.h> | |||||
| #include <sys/uio.h> | #include <sys/uio.h> | ||||
| #include <sys/poll.h> | |||||
| #include <sys/sbuf.h> | |||||
| #include <sys/kobj.h> | |||||
| #include <sys/module.h> | |||||
| #ifdef HAVE_KERNEL_OPTION_HEADERS | #ifdef HAVE_KERNEL_OPTION_HEADERS | ||||
| #include "opt_snd.h" | #include "opt_snd.h" | ||||
| #endif | #endif | ||||
| #include <dev/sound/midi/midi.h> | #include <dev/sound/midi/midi.h> | ||||
| #include <dev/sound/midi/midiq.h> | |||||
| #include "mpu_if.h" | #include "mpu_if.h" | ||||
| #include <dev/sound/midi/midiq.h> | |||||
| MALLOC_DEFINE(M_MIDI, "midi buffers", "Midi data allocation area"); | MALLOC_DEFINE(M_MIDI, "midi buffers", "Midi data allocation area"); | ||||
| #define MIDI_NAMELEN 16 | #define MIDI_NAMELEN 16 | ||||
| struct snd_midi { | struct snd_midi { | ||||
| KOBJ_FIELDS; | KOBJ_FIELDS; | ||||
| struct mtx lock; /* Protects all but queues */ | struct mtx lock; /* Protects all but queues */ | ||||
| void *cookie; | void *cookie; | ||||
| ▲ Show 20 Lines • Show All 705 Lines • Show Last 20 Lines | |||||
style(9) calls for sys/types.h first