From: Takashi Iwai Subject: Re: [alsa-cvslog] CVS: alsa-kernel/pci/ca0106 ca_midi.c,... Date: Fri, 21 Oct 2005 12:03:49 +0200 Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Tilman Kranz Cc: James Courtier-Dutton , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Fri, 21 Oct 2005 11:00:03 +0200 (METDST), Clemens Ladisch wrote: > > James Courtier-Dutton wrote: > > Log Message: > > Summary: snd-ca0106: Add midi support. > > Some nitpicks: > > > void ca_midi_interrupt(ca_midi_t *midi, unsigned int status) { > > ... > > if ((status & midi->ipr_tx) && ca_midi_output_ready(midi)) { > > if (midi->substream_output && > > snd_rawmidi_transmit(midi->substream_output, &byte, 1) == 1) { > > ca_midi_write_data(midi, byte); > > } else { > > midi->interrupt_disable(midi,midi->tx_enable); > > } > > } > > Shouldn't this be a while loop so that more than one byte can be > output in one interrupt? Another nitpics: Please no brace in the case of one-line if (as a convention). > +void ca0106_midi_interrupt_enable(ca_midi_t *midi, int intr){ > + snd_ca0106_intr_enable((ca0106_t *)(midi->dev_id), intr); > +} Please put the opening brace in the next line. Also, this and the following functions can be static. But, what is the reason to call them indirectly via pointers at all? The routine is just for ca0106, so no complex abstraction is necessary. Takashi ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl