From 7d0eef5f96d7f25935051570306ed92198592c85 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 4 Oct 2016 22:59:28 +0300 Subject: [PATCH] Bluetooth: Use proper const type for bt_storage_clear() The bt_storage_clear() function doesn't modify the data behind the addr parameter, so the pointer should be decared const. Change-Id: Icce676f9df80bac26ba4877bb63752559a43339f Signed-off-by: Johan Hedberg --- drivers/bluetooth/nble/gap.c | 2 +- include/bluetooth/storage.h | 2 +- net/bluetooth/hci_core.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/bluetooth/nble/gap.c b/drivers/bluetooth/nble/gap.c index fb5ec811a25..922c5159fec 100644 --- a/drivers/bluetooth/nble/gap.c +++ b/drivers/bluetooth/nble/gap.c @@ -389,7 +389,7 @@ void bt_storage_register(const struct bt_storage *bt_storage) storage = bt_storage; } -int bt_storage_clear(bt_addr_le_t *addr) +int bt_storage_clear(const bt_addr_le_t *addr) { clear_bonds(addr); /* FIXME: make the necessary storage callbacks too. */ diff --git a/include/bluetooth/storage.h b/include/bluetooth/storage.h index a7c3430b59a..d8b56972839 100644 --- a/include/bluetooth/storage.h +++ b/include/bluetooth/storage.h @@ -91,7 +91,7 @@ void bt_storage_register(const struct bt_storage *storage); * * @return 0 on success or negative error value on failure. */ -int bt_storage_clear(bt_addr_le_t *addr); +int bt_storage_clear(const bt_addr_le_t *addr); #ifdef __cplusplus } diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index ecb4d136feb..05137542988 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -4145,7 +4145,7 @@ void bt_storage_register(const struct bt_storage *storage) bt_storage = storage; } -int bt_storage_clear(bt_addr_le_t *addr) +int bt_storage_clear(const bt_addr_le_t *addr) { return -ENOSYS; }