Staging: line6: fix checkpatch errors in midi.c

Lots of warnings also fixed up.

Cc: Markus Grabner <grabner@icg.tugraz.at>
Cc: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman 2009-02-27 22:42:55 -08:00
parent 766f9d20a1
commit d7e3733619

View File

@ -26,19 +26,23 @@
#define OUTPUT_DUMP_ONLY 0
#define line6_rawmidi_substream_midi(substream) ((struct snd_line6_midi *)((substream)->rmidi->private_data))
#define line6_rawmidi_substream_midi(substream) \
((struct snd_line6_midi *)((substream)->rmidi->private_data))
static int send_midi_async(struct usb_line6 *line6, unsigned char *data, int length);
static int send_midi_async(struct usb_line6 *line6, unsigned char *data,
int length);
/*
Pass data received via USB to MIDI.
*/
void line6_midi_receive(struct usb_line6 *line6, unsigned char *data, int length)
void line6_midi_receive(struct usb_line6 *line6, unsigned char *data,
int length)
{
if (line6->line6midi->substream_receive)
snd_rawmidi_receive(line6->line6midi->substream_receive, data, length);
snd_rawmidi_receive(line6->line6midi->substream_receive,
data, length);
}
/*
@ -120,7 +124,8 @@ static void midi_sent(struct urb *urb)
Assumes that line6->line6midi->send_urb_lock is held
(i.e., this function is serialized).
*/
static int send_midi_async(struct usb_line6 *line6, unsigned char *data, int length)
static int send_midi_async(struct usb_line6 *line6, unsigned char *data,
int length)
{
struct urb *urb;
int retval;
@ -137,7 +142,7 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data, int len
line6_write_hexdump(line6, 'S', data, length);
#endif
transfer_buffer = (unsigned char *)kmalloc(length, GFP_ATOMIC);
transfer_buffer = kmalloc(length, GFP_ATOMIC);
if (transfer_buffer == 0) {
usb_free_urb(urb);
@ -146,10 +151,11 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data, int len
}
memcpy(transfer_buffer, data, length);
usb_fill_int_urb(urb,
line6->usbdev,
usb_sndbulkpipe(line6->usbdev, line6->ep_control_write),
transfer_buffer, length, midi_sent, line6, line6->interval);
usb_fill_int_urb(urb, line6->usbdev,
usb_sndbulkpipe(line6->usbdev,
line6->ep_control_write),
transfer_buffer, length, midi_sent, line6,
line6->interval);
urb->actual_length = 0;
retval = usb_submit_urb(urb, GFP_ATOMIC);
@ -169,7 +175,8 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data, int len
case LINE6_DEVID_PODXTLIVE:
case LINE6_DEVID_PODXTPRO:
case LINE6_DEVID_POCKETPOD:
pod_midi_postprocess((struct usb_line6_pod *)line6, data, length);
pod_midi_postprocess((struct usb_line6_pod *)line6, data,
length);
break;
default:
@ -189,7 +196,8 @@ static int line6_midi_output_close(struct snd_rawmidi_substream *substream)
return 0;
}
static void line6_midi_output_trigger(struct snd_rawmidi_substream *substream, int up)
static void line6_midi_output_trigger(struct snd_rawmidi_substream *substream,
int up)
{
unsigned long flags;
struct usb_line6 *line6 = line6_rawmidi_substream_midi(substream)->line6;
@ -231,7 +239,8 @@ static int line6_midi_input_close(struct snd_rawmidi_substream *substream)
return 0;
}
static void line6_midi_input_trigger(struct snd_rawmidi_substream *substream, int up)
static void line6_midi_input_trigger(struct snd_rawmidi_substream *substream,
int up)
{
struct usb_line6 *line6 = line6_rawmidi_substream_midi(substream)->line6;
@ -267,7 +276,9 @@ static int snd_line6_new_midi(struct snd_line6_midi *line6midi)
struct snd_rawmidi *rmidi;
int err;
if((err = snd_rawmidi_new(line6midi->line6->card, "Line6 MIDI", 0, 1, 1, &rmidi)) < 0)
err = snd_rawmidi_new(line6midi->line6->card, "Line6 MIDI", 0, 1, 1,
&rmidi);
if (err < 0)
return err;
rmidi->private_data = line6midi;
@ -279,8 +290,10 @@ static int snd_line6_new_midi(struct snd_line6_midi *line6midi)
SNDRV_RAWMIDI_INFO_INPUT |
SNDRV_RAWMIDI_INFO_DUPLEX;
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, &line6_midi_output_ops);
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, &line6_midi_input_ops);
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT,
&line6_midi_output_ops);
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT,
&line6_midi_input_ops);
return 0;
}
@ -371,12 +384,10 @@ int line6_init_midi(struct usb_line6 *line6)
return -ENOMEM;
err = midibuf_init(&line6midi->midibuf_in, MIDI_BUFFER_SIZE, 0);
if (err < 0)
return err;
err = midibuf_init(&line6midi->midibuf_out, MIDI_BUFFER_SIZE, 1);
if (err < 0)
return err;
@ -385,18 +396,23 @@ int line6_init_midi(struct usb_line6 *line6)
line6midi->midi_mask_receive = 4;
line6->line6midi = line6midi;
if((err = snd_device_new(line6->card, SNDRV_DEV_RAWMIDI, line6midi, &midi_ops)) < 0)
err = snd_device_new(line6->card, SNDRV_DEV_RAWMIDI, line6midi,
&midi_ops);
if (err < 0)
return err;
snd_card_set_dev(line6->card, line6->ifcdev);
if((err = snd_line6_new_midi(line6midi)) < 0)
err = snd_line6_new_midi(line6midi);
if (err < 0)
return err;
if((err = device_create_file(line6->ifcdev, &dev_attr_midi_mask_transmit)) < 0)
err = device_create_file(line6->ifcdev, &dev_attr_midi_mask_transmit);
if (err < 0)
return err;
if((err = device_create_file(line6->ifcdev, &dev_attr_midi_mask_receive)) < 0)
err = device_create_file(line6->ifcdev, &dev_attr_midi_mask_receive);
if (err < 0)
return err;
init_waitqueue_head(&line6midi->send_wait);