Bluetooth: remove redundant variables 'adv_set' and 'cp'
authorYueHaibing <yuehaibing@huawei.com>
Mon, 6 Aug 2018 11:08:51 +0000 (19:08 +0800)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 6 Aug 2018 14:06:58 +0000 (17:06 +0300)
Variables 'adv_set' and 'cp'  are being assigned but are never used hence
they are redundant and can be removed.

Cleans up clang warnings:
net/bluetooth/hci_event.c:1135:29: warning: variable 'adv_set' set but not used [-Wunused-but-set-variable]
net/bluetooth/mgmt.c:3359:39: warning: variable 'cp' set but not used [-Wunused-but-set-variable]

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_event.c
net/bluetooth/mgmt.c

index 754714c8d75288bc90c459bf4a659ac2e719ed7a..8078587572fee7a69d7e3d82cdf15883bfdac822 100644 (file)
@@ -1132,7 +1132,6 @@ static void hci_cc_le_set_ext_adv_enable(struct hci_dev *hdev,
                                         struct sk_buff *skb)
 {
        struct hci_cp_le_set_ext_adv_enable *cp;
-       struct hci_cp_ext_adv_set *adv_set;
        __u8 status = *((__u8 *) skb->data);
 
        BT_DBG("%s status 0x%2.2x", hdev->name, status);
@@ -1144,8 +1143,6 @@ static void hci_cc_le_set_ext_adv_enable(struct hci_dev *hdev,
        if (!cp)
                return;
 
-       adv_set = (void *) cp->data;
-
        hci_dev_lock(hdev);
 
        if (cp->enable) {
index 231602f7cb664bc10a1e5e039e55e6240236ee20..3bdc8f3ca259ed2d82bb9861033814d65591a51c 100644 (file)
@@ -3356,7 +3356,6 @@ int mgmt_phy_configuration_changed(struct hci_dev *hdev, struct sock *skip)
 static void set_default_phy_complete(struct hci_dev *hdev, u8 status,
                                     u16 opcode, struct sk_buff *skb)
 {
-       struct mgmt_cp_set_phy_confguration *cp;
        struct mgmt_pending_cmd *cmd;
 
        BT_DBG("status 0x%02x", status);
@@ -3367,8 +3366,6 @@ static void set_default_phy_complete(struct hci_dev *hdev, u8 status,
        if (!cmd)
                goto unlock;
 
-       cp = cmd->param;
-
        if (status) {
                mgmt_cmd_status(cmd->sk, hdev->id,
                                MGMT_OP_SET_PHY_CONFIGURATION,