Re: [PATCH 10/15] Bluetooth: Add a convenience function to check for SSP enabled

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

 



Hi Johan,

On Wed, Jan 18, 2012 at 08:51:52PM +0200, Johan Hedberg wrote:
> From: Johan Hedberg <johan.hedberg@xxxxxxxxx>
> 
> It's a very common test to see if both the local and the remote device
> have SSP enabled. By creating a simple function to test this we can
> shorten many if-statements in the code.
> 
> Signed-off-by: Johan Hedberg <johan.hedberg@xxxxxxxxx>
> ---
>  include/net/bluetooth/hci_core.h |    7 +++++++
>  net/bluetooth/hci_conn.c         |    8 ++------
>  net/bluetooth/hci_event.c        |    9 +++------
>  3 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
> index 5f6cb35..f2ccdae 100644
> --- a/include/net/bluetooth/hci_core.h
> +++ b/include/net/bluetooth/hci_core.h
> @@ -411,6 +411,13 @@ enum {
>  	HCI_CONN_REMOTE_OOB,
>  };
>  
> +static inline bool hci_conn_ssp_support(struct hci_conn *conn)

Maybe matter of taste but cold this be named hci_conn_ssp_supported ?
Then in if condition below it would be seen more natural and similar to
other "-ed" functions.

Best regards 
Andrei Emeltchenko 

> +	if (hci_conn_ssp_support(conn) && !(conn->link_mode & HCI_LM_ENCRYPT))
>  		return 0;

--
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