[alsa-devel] ALSA driver for Native Instruments sound hardware

Takashi Iwai tiwai at suse.de
Mon Mar 26 15:45:47 CEST 2007


At Fri, 23 Mar 2007 18:02:11 +0100,
Daniel Mack wrote:
> 
> diff -Nur alsa-kernel-ni/usb/caiaq/caiaq-audio.c alsa-kernel/usb/caiaq/caiaq-audio.c
> --- alsa-kernel-ni/usb/caiaq/caiaq-audio.c	1970-01-01 01:00:00.000000000 +0100
> +++ alsa-kernel/usb/caiaq/caiaq-audio.c	2007-03-23 17:33:59.000000000 +0100
> +
> +static int snd_usb_caiaq_pcm_trigger(struct snd_pcm_substream *substream, 
> +				     int cmd)
> +{
> +	struct snd_usb_caiaqdev *dev = snd_pcm_substream_chip(substream);
> +
> +	switch (cmd) {
> +		case SNDRV_PCM_TRIGGER_START:
> +		case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:

Put 'case' with the same indent level as switch.
(Ditto for all switch blocks in other places.)

> diff -Nur alsa-kernel-ni/usb/caiaq/caiaq-device.c alsa-kernel/usb/caiaq/caiaq-device.c
> --- alsa-kernel-ni/usb/caiaq/caiaq-device.c	1970-01-01 01:00:00.000000000 +0100
> +++ alsa-kernel/usb/caiaq/caiaq-device.c	2007-03-23 17:33:59.000000000 +0100
> +static void usb_ep1_command_reply_dispatch (struct urb* urb)
> +{
> +	int ret;
> +	struct snd_usb_caiaqdev *dev = urb->context;
> +	unsigned char *buf = urb->transfer_buffer;
> +
> +	if (urb->status || !dev) {
> +		log("%s: received urb->status = %i\n", __FUNCTION__, urb->status);
> +		return;
> +	}
> +
> +	switch(buf[0]) {
> +	case EP1_CMD_GET_DEVICE_INFO:
> +	{
> +	 	memcpy(&dev->spec, buf+1, sizeof(struct caiaq_device_spec));

Don't you need to convert 16bit values for big-endian?

Also, some lines are too long.  Please try to keep lines in 80 chars
as much as possible.


Thanks,

Takashi


More information about the Alsa-devel mailing list