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 inline bool
ExistConnectionByDestination(const bdaddr_t& destination, hci_id hid = -1) ExistConnectionByDestination(const bdaddr_t& destination, hci_id hid = -1)
{ {
return (ConnectionByDestination(destination, hid) != NULL); return ConnectionByDestination(destination, hid) != NULL;
} }
inline bool inline bool
ExistConnectionByHandle(uint16 handle, hci_id hid) ExistConnectionByHandle(uint16 handle, hci_id hid)
{ {
return (ConnectionByHandle(handle, hid)); return ConnectionByHandle(handle, hid);
} }
@@ -35,12 +35,12 @@ ChannelBySourceID(HciConnection *conn, uint16 scid)
uint16 uint16
ChannelAllocateCid(HciConnection* conn) ChannelAllocateCid(HciConnection* conn)
{ {
uint16 cid = conn->lastCid ; uint16 cid = conn->lastCid;
debugf("Starting search cid %d\n",cid); debugf("Starting search cid %d\n",cid);
do { 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; conn->lastCid = cid;
return cid; return cid;
} }
@@ -66,7 +66,7 @@ ChannelAllocateIdent(HciConnection* conn)
return ident; return ident;
} }
ident ++; ident++;
if (ident < L2CAP_FIRST_IDENT) if (ident < L2CAP_FIRST_IDENT)
ident = L2CAP_FIRST_IDENT; ident = L2CAP_FIRST_IDENT;
} }
@@ -82,7 +82,7 @@ AddChannel(HciConnection* conn, uint16 psm)
if (channel == NULL) { if (channel == NULL) {
flowf ("no mem for channel"); flowf ("no mem for channel");
return (NULL); return NULL;
} }
/* Get a new Source CID */ /* Get a new Source CID */
@@ -110,7 +110,7 @@ AddChannel(HciConnection* conn, uint16 psm)
channel = NULL; channel = NULL;
} }
return (channel); return channel;
} }
@@ -259,9 +259,10 @@ RegisterDriver(bt_hci_transport_hooks* hooks, bluetooth_device** _device)
if (sDeviceList.IsEmpty()) if (sDeviceList.IsEmpty())
device->index = HCI_DEVICE_INDEX_OFFSET; // REVIEW: dev index device->index = HCI_DEVICE_INDEX_OFFSET; // REVIEW: dev index
else else {
device->index = (sDeviceList.Tail())->index + 1; // REVIEW! device->index = (sDeviceList.Tail())->index + 1; // REVIEW!
flowf("List not empty\n"); flowf("List not empty\n");
}
sDeviceList.Add(device); sDeviceList.Add(device);