Coding style fixes

This commit is contained in:
Philippe Saint-Pierre
2015-06-25 18:03:41 -04:00
parent cc8f1d2ffd
commit 94817d608d
3 changed files with 11 additions and 10 deletions
@@ -21,14 +21,14 @@ net_buffer_module_info* gBufferModule = NULL;
inline bool
ExistConnectionByDestination(const bdaddr_t& destination, hci_id hid = -1)
{
return (ConnectionByDestination(destination, hid) != NULL);
return ConnectionByDestination(destination, hid) != NULL;
}
inline bool
ExistConnectionByHandle(uint16 handle, hci_id hid)
{
return (ConnectionByHandle(handle, hid));
return ConnectionByHandle(handle, hid);
}
@@ -35,12 +35,12 @@ ChannelBySourceID(HciConnection *conn, uint16 scid)
uint16
ChannelAllocateCid(HciConnection* conn)
{
uint16 cid = conn->lastCid ;
uint16 cid = conn->lastCid;
debugf("Starting search cid %d\n",cid);
do {
cid = (cid == L2CAP_LAST_CID)?L2CAP_FIRST_CID : cid + 1;
cid = (cid == L2CAP_LAST_CID) ? L2CAP_FIRST_CID : cid + 1;
if(ChannelBySourceID(conn, cid) == NULL) {
if (ChannelBySourceID(conn, cid) == NULL) {
conn->lastCid = cid;
return cid;
}
@@ -54,7 +54,7 @@ ChannelAllocateCid(HciConnection* conn)
uint16
ChannelAllocateIdent(HciConnection* conn)
{
uint8 ident = conn->lastIdent + 1;
uint8 ident = conn->lastIdent + 1;
if (ident < L2CAP_FIRST_IDENT)
ident = L2CAP_FIRST_IDENT;
@@ -66,7 +66,7 @@ ChannelAllocateIdent(HciConnection* conn)
return ident;
}
ident ++;
ident++;
if (ident < L2CAP_FIRST_IDENT)
ident = L2CAP_FIRST_IDENT;
}
@@ -82,7 +82,7 @@ AddChannel(HciConnection* conn, uint16 psm)
if (channel == NULL) {
flowf ("no mem for channel");
return (NULL);
return NULL;
}
/* Get a new Source CID */
@@ -110,7 +110,7 @@ AddChannel(HciConnection* conn, uint16 psm)
channel = NULL;
}
return (channel);
return channel;
}
@@ -259,9 +259,10 @@ RegisterDriver(bt_hci_transport_hooks* hooks, bluetooth_device** _device)
if (sDeviceList.IsEmpty())
device->index = HCI_DEVICE_INDEX_OFFSET; // REVIEW: dev index
else
else {
device->index = (sDeviceList.Tail())->index + 1; // REVIEW!
flowf("List not empty\n");
}
sDeviceList.Add(device);