Re: [PATCH v2 1/7] Bluetooth: Fix doing some useless casts when receiving MGMT commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
> ---
>  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@xxxxxxxxxxxx>

Regards

Marcel


--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux