All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Octavian Purdila
	<octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	Linus Walleij
	<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Alexandre Courbot
	<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
	Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
	Johan Hovold <johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Daniel Baluta
	<daniel.baluta-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Laurentiu Palcu
	<laurentiu.palcu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	lkml <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.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-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org> 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

WARNING: multiple messages have this Message-ID (diff)
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

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

Thread overview: 16+ 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 ` 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-09 20:27       ` Octavian Purdila
     [not found]       ` <CAE1zotJTQATJkTQinnWOg=NJbG+SWzNNdgB2uVEJgubnhtyXbA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-10  9:14         ` Johan Hovold [this message]
2014-10-10  9:14           ` Johan Hovold
     [not found] ` <1412882541-10934-1-git-send-email-octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
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     ` Octavian Purdila
2014-10-09 19:22   ` [PATCH v7 4/4] gpio: add support for the Diolan DLN-2 USB GPIO driver Octavian Purdila
2014-10-09 19:22     ` Octavian Purdila
2014-10-27 16:39     ` Linus Walleij
2014-10-09 19:22 ` [PATCH v7 3/4] gpiolib: add irq_not_threaded flag to gpio_chip Octavian Purdila
     [not found]   ` <1412882541-10934-4-git-send-email-octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-10-27 16:37     ` Linus Walleij
2014-10-27 16:37       ` 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-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=daniel.baluta-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org \
    --cc=laurentiu.palcu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.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.