From: Clemens Ladisch <clemens@ladisch.de>
To: Krzysztof Foltman <wdev@foltman.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH 1/1] ALSA: usb-audio: add support for Akai MPD16
Date: Wed, 19 May 2010 08:59:38 +0200 [thread overview]
Message-ID: <4BF38C5A.7040901@ladisch.de> (raw)
In-Reply-To: <1274207876-3215-1-git-send-email-wdev@foltman.com>
Krzysztof Foltman wrote:
> + * AKAI MPD16 protocol: one or more chunks consisting of first byte of
> + * (0x20 | msg_len) and then a MIDI message (msg_len bytes long)
> + *
> + * Messages sent:
> + * 21 FE (active sense)
> + * 23 90 xx xx (note on)
> + * 23 Ax xx xx (polyphonic pressure)
> + * 23 Bx xx xx (control change)
> + */
> +static void snd_usbmidi_akai_input(struct snd_usb_midi_in_endpoint *ep,
> + uint8_t *buffer, int buffer_length)
> +{
> + unsigned int pos = 0;
> + while (pos < (unsigned)buffer_length && (buffer[pos] & 0xF8) == 0x20) {
> + int msg_len = buffer[pos] & 0x0f;
> + snd_usbmidi_input_data(ep, 0, &buffer[pos + 1], msg_len);
This might overflow if the buffer ends with a 2x byte.
> +static struct usb_protocol_ops snd_usbmidi_akai_ops = {
> + .input = snd_usbmidi_akai_input,
> + .output = snd_usbmidi_standard_output,
> + .output_packet = snd_usbmidi_output_standard_packet,
Assuming that this device doesn't have any output ports, please add a
comment that this isn't the actual output protocol.
> checkpatch.pl also complains about the use of space after the
> ampersand in quirks-table.h, where it seems to be a common practice.
I'd value consistency over some stupid script, but this issue isn't
important enough to worry over.
Overall, the patch looks fine.
Regards,
Clemens
next prev parent reply other threads:[~2010-05-19 6:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-18 18:37 [PATCH 1/1] ALSA: usb-audio: add support for Akai MPD16 Krzysztof Foltman
2010-05-19 6:59 ` Clemens Ladisch [this message]
2010-05-19 20:31 ` Krzysztof Foltman
-- strict thread matches above, loose matches on Subject: below --
2010-05-20 19:31 Krzysztof Foltman
2010-05-19 20:06 Krzysztof Foltman
2010-05-20 7:26 ` Clemens Ladisch
2010-05-20 7:49 ` Krzysztof Foltman
2010-05-20 9:21 ` Clemens Ladisch
2010-05-25 9:07 ` Krzysztof Foltman
2010-05-25 9:39 ` Daniel Mack
2010-05-17 22:48 wdev
2010-05-18 0:38 ` Daniel Mack
2010-05-18 18:36 ` Krzysztof Foltman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BF38C5A.7040901@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=wdev@foltman.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.