All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@zonque.org>
To: Mario Kicherer <dev@kicherer.org>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] MIDI driver for Behringer BCD2000 USB device
Date: Thu, 20 Feb 2014 13:44:59 +0100	[thread overview]
Message-ID: <5305F8CB.30506@zonque.org> (raw)
In-Reply-To: <1392899467-8956-1-git-send-email-dev@kicherer.org>

On 02/20/2014 01:31 PM, Mario Kicherer wrote:
> This patch adds initial support for the Behringer BCD2000 USB DJ controller.
> At the moment, only the MIDI part of the device is working, i.e. knobs,
> buttons and LEDs.
> 
> I also plan to add support for the audio part, but I assume that this will
> require more effort than the rather simple MIDI interface. Progress can be
> tracked at https://github.com/anyc/snd-usb-bcd2000. 

...

> +static int bcd2000_probe(struct usb_interface *interface,
> +				const struct usb_device_id *usb_id)
> +{

...

> +	usb_set_intfdata(interface, bcd2k);
> +	devices_used[card_index/sizeof(int)*8] |=
> +		1 << (card_index%(sizeof(int)*8));
> +

...

> +static void bcd2000_disconnect(struct usb_interface *interface)
> +{

...

> +	devices_used[bcd2k->card_index/sizeof(int)*8] &=
> +		~(1 << (bcd2k->card_index%(sizeof(int)*8)));

We have much nicer ways of doing this :)

Have a look at include/linux/bitmap.h, especially set_bit(), clear_bit()
and DECLARE_BITMAP().

  reply	other threads:[~2014-02-20 12:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-20 12:31 [PATCH] MIDI driver for Behringer BCD2000 USB device Mario Kicherer
2014-02-20 12:44 ` Daniel Mack [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-02-01 19:54 Mario Kicherer
2014-02-05 10:54 ` Daniel Mack
2014-02-05 15:33   ` Mario Kicherer
2014-02-05 15:49     ` Daniel Mack

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=5305F8CB.30506@zonque.org \
    --to=daniel@zonque.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=dev@kicherer.org \
    /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.