From: Gustavo Padovan <padovan@profusion.mobi>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Andre Guedes <andre.guedes@openbossa.org>,
linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 3/3] Bluetooth: Code refactoring
Date: Wed, 9 Nov 2011 21:16:42 -0200 [thread overview]
Message-ID: <20111109231641.GA2546@joana> (raw)
In-Reply-To: <1320877088.15441.350.camel@aeonflux>
Hi Marcel,
* Marcel Holtmann <marcel@holtmann.org> [2011-11-10 07:18:05 +0900]:
> Hi Andre,
>
> > This patch adds the helper function cmd_failed() to handle mgmt
> > commands failures. This function sends the proper command status
> > event and removes the command from the pending list.
> >
> > Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
> > ---
> > net/bluetooth/mgmt.c | 53 +++++++++++++++++--------------------------------
> > 1 files changed, 19 insertions(+), 34 deletions(-)
>
> Acked-by: Marcel Holtmann <marcel@holtmann.org>
>
> <snip>
>
> > int mgmt_disconnect_failed(struct hci_dev *hdev)
> > {
> > - struct pending_cmd *cmd;
> > - int err;
> > -
> > - cmd = mgmt_pending_find(MGMT_OP_DISCONNECT, hdev);
> > - if (!cmd)
> > - return -ENOENT;
> > -
> > - err = cmd_status(cmd->sk, hdev->id, MGMT_OP_DISCONNECT, EIO);
> > -
> > - mgmt_pending_remove(cmd);
> > -
> > - return err;
> > + return cmd_failed(hdev, MGMT_OP_DISCONNECT, EIO);
> > }
>
> So the only left-over question now is if we need to keep these empty
> stub functions around or can just call cmd_failed directly.
>
> It might be actually cleaner to just call cmd_failed directly.
We can convert everything to macros and get rid of these stubs. IMHO this is a
cleaner solution.
Gustavo
next prev parent reply other threads:[~2011-11-09 23:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-09 20:14 [PATCH 1/3] Bluetooth: Rename mgmt_inquiry_failed() Andre Guedes
2011-11-09 20:14 ` [PATCH 2/3] Bluetooth: mgmt_stop_discovery_failed() Andre Guedes
2011-11-09 22:16 ` Marcel Holtmann
2011-11-16 17:41 ` Gustavo Padovan
2011-11-09 20:14 ` [PATCH 3/3] Bluetooth: Code refactoring Andre Guedes
2011-11-09 22:18 ` Marcel Holtmann
2011-11-09 22:41 ` Andre Guedes
2011-11-09 22:44 ` Marcel Holtmann
2011-11-09 23:16 ` Gustavo Padovan [this message]
2011-11-09 22:15 ` [PATCH 1/3] Bluetooth: Rename mgmt_inquiry_failed() Marcel Holtmann
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=20111109231641.GA2546@joana \
--to=padovan@profusion.mobi \
--cc=andre.guedes@openbossa.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.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;
as well as URLs for NNTP newsgroup(s).