From: Johan Hedberg Date: Fri, 4 Jul 2014 09:37:20 +0000 (+0300) Subject: Bluetooth: Don't bother doing anything if auto_connect doesn't change X-Git-Tag: v3.17-rc1~106^2~12^2~41^2~147 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=42ce26de67e13c50885e7856ff91aaeedf07a81b;p=platform%2Fkernel%2Flinux-exynos.git Bluetooth: Don't bother doing anything if auto_connect doesn't change When hci_conn_params_set() is called if the new auto_connect value is the same as the old one we don't need to take any action. Simply return success from the function in this case. Signed-off-by: Johan Hedberg Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index dd8aa5f..0601fcb 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3525,6 +3525,9 @@ int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type, if (!params) return -EIO; + if (params->auto_connect == auto_connect) + return 0; + if (params->auto_connect == HCI_AUTO_CONN_REPORT && auto_connect != HCI_AUTO_CONN_REPORT) list_del_init(¶ms->action);