From: Marcel Holtmann <marcel@holtmann.org>
To: Gustavo Padovan <gustavo@padovan.org>
Cc: Andrei Emeltchenko <andrei.emeltchenko.news@gmail.com>,
linux-bluetooth@vger.kernel.org,
Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Subject: Re: [PATCH -v2 12/12] Bluetooth: Used void * as parameter in alloc_skb()
Date: Sun, 27 May 2012 07:11:34 +0200 [thread overview]
Message-ID: <1338095494.15105.106.camel@aeonflux> (raw)
In-Reply-To: <20120525124139.GD31623@joana>
Hi Gustavo,
> > On Fri, May 25, 2012 at 09:31:04AM -0300, Gustavo Padovan wrote:
> > > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > >
> > > This keep l2cap chan ops functions parameters in sync.
> > >
> > > Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> >
> > ...
> >
> > > diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
> > > index 25a85ab..0f8886b 100644
> > > --- a/include/net/bluetooth/l2cap.h
> > > +++ b/include/net/bluetooth/l2cap.h
> > > @@ -532,8 +532,8 @@ struct l2cap_ops {
> > > void (*close) (void *data);
> > > void (*teardown) (void *data, int err);
> > > void (*state_change) (void *data, int state);
> > > - struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan,
> > > - unsigned long len, int nb);
> > > + struct sk_buff *(*alloc_skb) (void *data, unsigned long len,
> > > + int nb);
> >
> > ...
> >
> > > @@ -1893,7 +1893,7 @@ static inline int l2cap_skbuff_fromiovec(struct l2cap_chan *chan,
> > >
> > > count = min_t(unsigned int, conn->mtu, len);
> > >
> > > - tmp = chan->ops->alloc_skb(chan, count,
> > > + tmp = chan->ops->alloc_skb(chan->data, count,
> >
> > Why do we need to pass chan->data instead of chan?
>
> We are changing this to make this call have the same parameter as the other
> ops calls, i.e., a void *, so we just pass chan->data here which is the user
> data (struct sock *sk in the l2cap_sock.c case).
so what is the problem to just pass l2cap_chan in here for all calls and
then have the it do chan->data inside the callback. This void *data
thing is dead ugly.
Regards
Marcel
prev parent reply other threads:[~2012-05-27 5:11 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-25 12:30 [PATCH -v2 00/12] Another step in l2cap_core/sock separation Gustavo Padovan
2012-05-25 12:30 ` [PATCH -v2 01/12] Bluetooth: Remove extra l2cap_state_change(BT_CONNECTED) Gustavo Padovan
2012-05-27 4:59 ` Marcel Holtmann
2012-05-25 12:30 ` [PATCH -v2 02/12] Bluetooth: Move clean up code and set of SOCK_ZAPPED to l2cap_sock.c Gustavo Padovan
2012-05-27 5:00 ` Marcel Holtmann
2012-05-28 6:49 ` Andrei Emeltchenko
2012-05-25 12:30 ` [PATCH -v2 03/12] Bluetooth: Add l2cap_chan->ops->ready() Gustavo Padovan
2012-05-27 5:01 ` Marcel Holtmann
2012-05-25 12:30 ` [PATCH -v2 04/12] Bluetooth: Use l2cap_chan_ready() in LE path Gustavo Padovan
2012-05-27 5:02 ` Marcel Holtmann
2012-05-25 12:30 ` [PATCH -v2 05/12] Bluetooth: Use chan->state instead of sk->sk_state Gustavo Padovan
2012-05-27 5:04 ` Marcel Holtmann
2012-05-25 12:30 ` [PATCH -v2 06/12] Bluetooth: Move check for backlog size to l2cap_sock.c Gustavo Padovan
2012-05-25 12:30 ` [PATCH -v2 07/12] Bluetooth: Create DEFER_SETUP flag in conf_state Gustavo Padovan
2012-05-27 5:07 ` Marcel Holtmann
2012-05-27 19:00 ` Gustavo Padovan
2012-05-28 3:48 ` Marcel Holtmann
2012-05-28 16:36 ` Gustavo Padovan
2012-05-25 12:31 ` [PATCH -v2 08/12] Bluetooth: Add chan->ops->defer() Gustavo Padovan
2012-05-27 5:08 ` Marcel Holtmann
2012-05-25 12:31 ` [PATCH -v2 09/12] Bluetooth: check for already existent channel before create new one Gustavo Padovan
2012-05-27 5:09 ` Marcel Holtmann
2012-05-25 12:31 ` [PATCH -v2 10/12] Bluetooth: Move bt_accept_enqueue() call to l2cap_sock.c Gustavo Padovan
2012-05-25 16:18 ` Mat Martineau
2012-05-25 12:31 ` [PATCH -v2 11/12] Bluetooth: Remove parent socket usage from l2cap_core.c Gustavo Padovan
2012-05-25 12:31 ` [PATCH -v2 12/12] Bluetooth: Used void * as parameter in alloc_skb() Gustavo Padovan
2012-05-25 12:39 ` Andrei Emeltchenko
2012-05-25 12:41 ` Gustavo Padovan
2012-05-27 5:11 ` Marcel Holtmann [this message]
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=1338095494.15105.106.camel@aeonflux \
--to=marcel@holtmann.org \
--cc=andrei.emeltchenko.news@gmail.com \
--cc=gustavo.padovan@collabora.co.uk \
--cc=gustavo@padovan.org \
--cc=linux-bluetooth@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox