linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Octavian Purdila <octavian.purdila@intel.com>
Cc: Joe Perches <joe@perches.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Wolfram Sang <wsa@the-dreams.de>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Lee Jones <lee.jones@linaro.org>, Arnd Bergmann <arnd@arndb.de>,
	Johan Hovold <johan@kernel.org>,
	Daniel Baluta <daniel.baluta@intel.com>,
	Laurentiu Palcu <laurentiu.palcu@intel.com>,
	linux-usb@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	linux-i2c@vger.kernel.org
Subject: Re: [PATCH v7 1/4] mfd: add support for Diolan DLN-2 devices
Date: Fri, 10 Oct 2014 11:14:34 +0200	[thread overview]
Message-ID: <20141010091434.GB12494@localhost> (raw)
In-Reply-To: <CAE1zotJTQATJkTQinnWOg=NJbG+SWzNNdgB2uVEJgubnhtyXbA@mail.gmail.com>

On Thu, Oct 09, 2014 at 11:27:12PM +0300, Octavian Purdila wrote:
> On Thu, Oct 9, 2014 at 10:44 PM, Joe Perches <joe@perches.com> wrote:
> > On Thu, 2014-10-09 at 22:22 +0300, Octavian Purdila wrote:

> >> diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c
> > []
> > +struct dln2_mod_rx_slots {
> > +       /* RX slots bitmap */
> > +       unsigned long bmap;
> >
> > Probably better as:
> >         DECLARE_BITMAP(bmap, DLN2_MAX_RX_SLOTS);
> >
> > Then a lot of &ptr->bmap uses can be ptr->bmap
> >
> 
> Originally I was using DECLARE_BITMAP, but during the review process
> Johan suggested to use unsigned long. Now that I think about it, it
> sounds better to use DECLARE_BITMAP and of couse keep using
> find_first_bit, set_bit, etc. Johan do you see any issue with that?

No, that's fine as long as you keep the bitops.

> >> +struct dln2_dev {
> >> +     struct usb_device *usb_dev;
> >> +     struct usb_interface *interface;
> >> +     u8 ep_in;
> >> +     u8 ep_out;
> >> +
> >> +     struct urb *rx_urb[DLN2_MAX_URBS];
> >> +     void *rx_buf[DLN2_MAX_URBS];
> >> +
> >> +     struct dln2_mod_rx_slots mod_rx_slots[DLN2_HANDLES];
> >> +
> >> +     struct list_head event_cb_list;
> >> +     spinlock_t event_cb_lock;
> >> +
> >> +     bool disconnect;
> >> +     int active_transfers;
> >> +     wait_queue_head_t disconnect_wq;
> >> +     spinlock_t disconnect_lock;
> >> +};
> >
> > Maybe reorder the bools and u8s to pack this a bit better?
> 
> I prefer to keep it this way, it's not wasting a lot since you will
> only have a handful of these devices, and it keeps the related data
> together.

I agree.

Johan

  reply	other threads:[~2014-10-10  9:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-09 19:22 [PATCH v7 0/4] mfd: add support for Diolan DLN-2 Octavian Purdila
2014-10-09 19:22 ` [PATCH v7 1/4] mfd: add support for Diolan DLN-2 devices Octavian Purdila
2014-10-09 19:44   ` Joe Perches
2014-10-09 20:27     ` Octavian Purdila
2014-10-10  9:14       ` Johan Hovold [this message]
2014-10-09 19:22 ` [PATCH v7 2/4] i2c: add support for Diolan DLN-2 USB-I2C adapter Octavian Purdila
2014-10-09 19:22 ` [PATCH v7 3/4] gpiolib: add irq_not_threaded flag to gpio_chip Octavian Purdila
2014-10-27 16:37   ` Linus Walleij
2014-10-09 19:22 ` [PATCH v7 4/4] gpio: add support for the Diolan DLN-2 USB GPIO driver Octavian Purdila
2014-10-27 16:39   ` Linus Walleij

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=20141010091434.GB12494@localhost \
    --to=johan@kernel.org \
    --cc=arnd@arndb.de \
    --cc=daniel.baluta@intel.com \
    --cc=gnurou@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=laurentiu.palcu@intel.com \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=octavian.purdila@intel.com \
    --cc=sameo@linux.intel.com \
    --cc=wsa@the-dreams.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).