Linux bluetooth development
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v2 1/7] Bluetooth: Fix doing some useless casts when receiving MGMT commands
Date: Thu, 02 Feb 2012 16:20:10 -0800	[thread overview]
Message-ID: <1328228410.2062.18.camel@aeonflux> (raw)
In-Reply-To: <1328227685-27245-2-git-send-email-vinicius.gomes@openbossa.org>

Hi Vinicius,

> Every command handler of mgmt does a cast to the command structure
> so it can properly interpreted. So we can avoid that cast if we
> make those functions receive a void * directly.
> 
> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
> ---
>  net/bluetooth/mgmt.c |  210 +++++++++++++++++++++-----------------------------
>  1 files changed, 88 insertions(+), 122 deletions(-)
> 
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> index 00ab083..f8720de 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -611,15 +611,13 @@ static int send_settings_rsp(struct sock *sk, u16 opcode, struct hci_dev *hdev)
>  	return cmd_complete(sk, hdev->id, opcode, &settings, sizeof(settings));
>  }
>  
> -static int set_powered(struct sock *sk, u16 index, unsigned char *data, u16 len)
> +static int set_powered(struct sock *sk, u16 index, void *cp_data, u16 len)
>  {
> -	struct mgmt_mode *cp;
> +	struct mgmt_mode *cp = cp_data;

why are we doing the rename to cp_data here. I rather keep this as
*data. Otherwise this is fine.

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



  reply	other threads:[~2012-02-03  0:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03  0:07 [PATCH v2 0/7] New MGMT messages for SMP Long Term Keys Vinicius Costa Gomes
2012-02-03  0:07 ` [PATCH v2 1/7] Bluetooth: Fix doing some useless casts when receiving MGMT commands Vinicius Costa Gomes
2012-02-03  0:20   ` Marcel Holtmann [this message]
2012-02-03  0:08 ` [PATCH v2 2/7] Bluetooth: Add new structures for handling SMP Long Term Keys Vinicius Costa Gomes
2012-02-03  0:08 ` [PATCH v2 3/7] Bluetooth: Use the updated key structures for handling LTKs Vinicius Costa Gomes
2012-02-03  0:23   ` Marcel Holtmann
2012-02-03  0:08 ` [PATCH v2 4/7] Bluetooth: Add MGMT handlers for dealing with SMP LTK's Vinicius Costa Gomes
2012-02-03  0:24   ` Marcel Holtmann
2012-02-03  0:08 ` [PATCH v2 5/7] Bluetooth: Add support for removing LTK's when pairing is removed Vinicius Costa Gomes
2012-02-03  0:08 ` [PATCH v2 6/7] Bluetooth: Clean up structures left unused Vinicius Costa Gomes
2012-02-03  0:08 ` [PATCH v2 7/7] Bluetooth: Add support for notifying userspace of new LTK's Vinicius Costa Gomes
2012-02-03  1:25 ` [PATCH v2 0/7] New MGMT messages for SMP Long Term Keys Johan Hedberg

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=1328228410.2062.18.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=vinicius.gomes@openbossa.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