Bluetooth: Remove return values from functions that don't need them

There are many functions that never fail but still declare an integer
return value for no reason. This patch converts these functions to use a
void return value to avoid any confusion of whether they can fail or not.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
Johan Hedberg 2014-02-18 17:14:32 +02:00 committed by Marcel Holtmann
parent e0b2b27e62
commit 35f7498a87
3 changed files with 15 additions and 23 deletions

View File

@ -768,7 +768,7 @@ int hci_inquiry(void __user *arg);
struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev,
bdaddr_t *bdaddr, u8 type); bdaddr_t *bdaddr, u8 type);
int hci_blacklist_clear(struct hci_dev *hdev); void hci_blacklist_clear(struct hci_dev *hdev);
int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
@ -779,9 +779,9 @@ void hci_conn_params_add(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type,
void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type); void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type);
void hci_conn_params_clear(struct hci_dev *hdev); void hci_conn_params_clear(struct hci_dev *hdev);
int hci_uuids_clear(struct hci_dev *hdev); void hci_uuids_clear(struct hci_dev *hdev);
int hci_link_keys_clear(struct hci_dev *hdev); void hci_link_keys_clear(struct hci_dev *hdev);
struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len); bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len);
@ -793,7 +793,7 @@ int hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type, u8 type,
struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr, struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr,
u8 addr_type, bool master); u8 addr_type, bool master);
int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type); int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type);
int hci_smp_ltks_clear(struct hci_dev *hdev); void hci_smp_ltks_clear(struct hci_dev *hdev);
int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
struct smp_irk *hci_find_irk_by_rpa(struct hci_dev *hdev, bdaddr_t *rpa); struct smp_irk *hci_find_irk_by_rpa(struct hci_dev *hdev, bdaddr_t *rpa);
@ -803,7 +803,7 @@ int hci_add_irk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type,
u8 val[16], bdaddr_t *rpa); u8 val[16], bdaddr_t *rpa);
void hci_smp_irks_clear(struct hci_dev *hdev); void hci_smp_irks_clear(struct hci_dev *hdev);
int hci_remote_oob_data_clear(struct hci_dev *hdev); void hci_remote_oob_data_clear(struct hci_dev *hdev);
struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev, struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev,
bdaddr_t *bdaddr); bdaddr_t *bdaddr);
int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr,

View File

@ -2506,7 +2506,7 @@ static void hci_discov_off(struct work_struct *work)
mgmt_discoverable_timeout(hdev); mgmt_discoverable_timeout(hdev);
} }
int hci_uuids_clear(struct hci_dev *hdev) void hci_uuids_clear(struct hci_dev *hdev)
{ {
struct bt_uuid *uuid, *tmp; struct bt_uuid *uuid, *tmp;
@ -2514,11 +2514,9 @@ int hci_uuids_clear(struct hci_dev *hdev)
list_del(&uuid->list); list_del(&uuid->list);
kfree(uuid); kfree(uuid);
} }
return 0;
} }
int hci_link_keys_clear(struct hci_dev *hdev) void hci_link_keys_clear(struct hci_dev *hdev)
{ {
struct list_head *p, *n; struct list_head *p, *n;
@ -2530,11 +2528,9 @@ int hci_link_keys_clear(struct hci_dev *hdev)
list_del(p); list_del(p);
kfree(key); kfree(key);
} }
return 0;
} }
int hci_smp_ltks_clear(struct hci_dev *hdev) void hci_smp_ltks_clear(struct hci_dev *hdev)
{ {
struct smp_ltk *k, *tmp; struct smp_ltk *k, *tmp;
@ -2542,8 +2538,6 @@ int hci_smp_ltks_clear(struct hci_dev *hdev)
list_del(&k->list); list_del(&k->list);
kfree(k); kfree(k);
} }
return 0;
} }
void hci_smp_irks_clear(struct hci_dev *hdev) void hci_smp_irks_clear(struct hci_dev *hdev)
@ -2873,7 +2867,7 @@ int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr)
return 0; return 0;
} }
int hci_remote_oob_data_clear(struct hci_dev *hdev) void hci_remote_oob_data_clear(struct hci_dev *hdev)
{ {
struct oob_data *data, *n; struct oob_data *data, *n;
@ -2881,8 +2875,6 @@ int hci_remote_oob_data_clear(struct hci_dev *hdev)
list_del(&data->list); list_del(&data->list);
kfree(data); kfree(data);
} }
return 0;
} }
int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
@ -2951,7 +2943,7 @@ struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev,
return NULL; return NULL;
} }
int hci_blacklist_clear(struct hci_dev *hdev) void hci_blacklist_clear(struct hci_dev *hdev)
{ {
struct list_head *p, *n; struct list_head *p, *n;
@ -2961,8 +2953,6 @@ int hci_blacklist_clear(struct hci_dev *hdev)
list_del(p); list_del(p);
kfree(b); kfree(b);
} }
return 0;
} }
int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type) int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type)
@ -2991,8 +2981,10 @@ int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type)
{ {
struct bdaddr_list *entry; struct bdaddr_list *entry;
if (!bacmp(bdaddr, BDADDR_ANY)) if (!bacmp(bdaddr, BDADDR_ANY)) {
return hci_blacklist_clear(hdev); hci_blacklist_clear(hdev);
return 0;
}
entry = hci_blacklist_lookup(hdev, bdaddr, type); entry = hci_blacklist_lookup(hdev, bdaddr, type);
if (!entry) if (!entry)

View File

@ -2073,7 +2073,7 @@ static int remove_uuid(struct sock *sk, struct hci_dev *hdev, void *data,
} }
if (memcmp(cp->uuid, bt_uuid_any, 16) == 0) { if (memcmp(cp->uuid, bt_uuid_any, 16) == 0) {
err = hci_uuids_clear(hdev); hci_uuids_clear(hdev);
if (enable_service_cache(hdev)) { if (enable_service_cache(hdev)) {
err = cmd_complete(sk, hdev->id, MGMT_OP_REMOVE_UUID, err = cmd_complete(sk, hdev->id, MGMT_OP_REMOVE_UUID,