From: Marcel Holtmann <marcel@holtmann.org>
To: Andre Guedes <andre.guedes@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 3/3] Bluetooth: Code refactoring
Date: Thu, 10 Nov 2011 07:44:50 +0900 [thread overview]
Message-ID: <1320878693.15441.362.camel@aeonflux> (raw)
In-Reply-To: <A9331507-78CC-4AC9-9947-1FA37247ECC7@openbossa.org>
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.
>
> I've asked myself the same question. If we wanna have hci_core layer
> calling cmd_failed() we need to include mgmt.h header so we have access
> to mgmt commands opcodes.
fair enough. Leave it as it is for now.
Regards
Marcel
next prev parent reply other threads:[~2011-11-09 22:44 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 [this message]
2011-11-09 23:16 ` Gustavo Padovan
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=1320878693.15441.362.camel@aeonflux \
--to=marcel@holtmann.org \
--cc=andre.guedes@openbossa.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;
as well as URLs for NNTP newsgroup(s).