Bluetooth: Coding style fix
1. Add space when needed; 2. Block comments style fix; 3. Move open brace '{' following function definitions to the next line; 4. Remove unnecessary braces '{}' for single statement blocks. Signed-off-by: Meng Yu <yumeng18@huawei.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
82a1242619
commit
149b3f13b4
|
@ -205,8 +205,7 @@ static inline struct lowpan_peer *peer_lookup_dst(struct lowpan_btle_dev *dev,
|
|||
}
|
||||
}
|
||||
|
||||
/* use the neighbour cache for matching addresses assigned by SLAAC
|
||||
*/
|
||||
/* use the neighbour cache for matching addresses assigned by SLAAC */
|
||||
neigh = __ipv6_neigh_lookup(dev->netdev, nexthop);
|
||||
if (neigh) {
|
||||
list_for_each_entry_rcu(peer, &dev->peers, list) {
|
||||
|
|
|
@ -274,7 +274,7 @@ static ssize_t use_debug_keys_read(struct file *file, char __user *user_buf,
|
|||
struct hci_dev *hdev = file->private_data;
|
||||
char buf[3];
|
||||
|
||||
buf[0] = hci_dev_test_flag(hdev, HCI_USE_DEBUG_KEYS) ? 'Y': 'N';
|
||||
buf[0] = hci_dev_test_flag(hdev, HCI_USE_DEBUG_KEYS) ? 'Y' : 'N';
|
||||
buf[1] = '\n';
|
||||
buf[2] = '\0';
|
||||
return simple_read_from_buffer(user_buf, count, ppos, buf, 2);
|
||||
|
@ -292,7 +292,7 @@ static ssize_t sc_only_mode_read(struct file *file, char __user *user_buf,
|
|||
struct hci_dev *hdev = file->private_data;
|
||||
char buf[3];
|
||||
|
||||
buf[0] = hci_dev_test_flag(hdev, HCI_SC_ONLY) ? 'Y': 'N';
|
||||
buf[0] = hci_dev_test_flag(hdev, HCI_SC_ONLY) ? 'Y' : 'N';
|
||||
buf[1] = '\n';
|
||||
buf[2] = '\0';
|
||||
return simple_read_from_buffer(user_buf, count, ppos, buf, 2);
|
||||
|
@ -428,7 +428,7 @@ static ssize_t ssp_debug_mode_read(struct file *file, char __user *user_buf,
|
|||
struct hci_dev *hdev = file->private_data;
|
||||
char buf[3];
|
||||
|
||||
buf[0] = hdev->ssp_debug_mode ? 'Y': 'N';
|
||||
buf[0] = hdev->ssp_debug_mode ? 'Y' : 'N';
|
||||
buf[1] = '\n';
|
||||
buf[2] = '\0';
|
||||
return simple_read_from_buffer(user_buf, count, ppos, buf, 2);
|
||||
|
@ -742,7 +742,7 @@ static ssize_t force_static_address_read(struct file *file,
|
|||
struct hci_dev *hdev = file->private_data;
|
||||
char buf[3];
|
||||
|
||||
buf[0] = hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR) ? 'Y': 'N';
|
||||
buf[0] = hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR) ? 'Y' : 'N';
|
||||
buf[1] = '\n';
|
||||
buf[2] = '\0';
|
||||
return simple_read_from_buffer(user_buf, count, ppos, buf, 2);
|
||||
|
|
|
@ -5891,7 +5891,7 @@ static void hci_le_remote_conn_param_req_evt(struct hci_dev *hdev,
|
|||
params->conn_latency = latency;
|
||||
params->supervision_timeout = timeout;
|
||||
store_hint = 0x01;
|
||||
} else{
|
||||
} else {
|
||||
store_hint = 0x00;
|
||||
}
|
||||
|
||||
|
|
|
@ -1647,9 +1647,8 @@ static u8 create_default_scan_rsp_data(struct hci_dev *hdev, u8 *ptr)
|
|||
{
|
||||
u8 scan_rsp_len = 0;
|
||||
|
||||
if (hdev->appearance) {
|
||||
if (hdev->appearance)
|
||||
scan_rsp_len = append_appearance(hdev, ptr, scan_rsp_len);
|
||||
}
|
||||
|
||||
return append_local_name(hdev, ptr, scan_rsp_len);
|
||||
}
|
||||
|
@ -1667,9 +1666,8 @@ static u8 create_instance_scan_rsp_data(struct hci_dev *hdev, u8 instance,
|
|||
|
||||
instance_flags = adv_instance->flags;
|
||||
|
||||
if ((instance_flags & MGMT_ADV_FLAG_APPEARANCE) && hdev->appearance) {
|
||||
if ((instance_flags & MGMT_ADV_FLAG_APPEARANCE) && hdev->appearance)
|
||||
scan_rsp_len = append_appearance(hdev, ptr, scan_rsp_len);
|
||||
}
|
||||
|
||||
memcpy(&ptr[scan_rsp_len], adv_instance->scan_rsp_data,
|
||||
adv_instance->scan_rsp_len);
|
||||
|
|
|
@ -652,7 +652,7 @@ void l2cap_chan_del(struct l2cap_chan *chan, int err)
|
|||
if (test_bit(CONF_NOT_COMPLETE, &chan->conf_state))
|
||||
return;
|
||||
|
||||
switch(chan->mode) {
|
||||
switch (chan->mode) {
|
||||
case L2CAP_MODE_BASIC:
|
||||
break;
|
||||
|
||||
|
@ -7770,7 +7770,8 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon)
|
|||
return conn;
|
||||
}
|
||||
|
||||
static bool is_valid_psm(u16 psm, u8 dst_type) {
|
||||
static bool is_valid_psm(u16 psm, u8 dst_type)
|
||||
{
|
||||
if (!psm)
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Reference in New Issue