Skip to contentSkip to conversation

Bluetooth: Remove unnecessary params variable from process_adv_report()

PATCH In review [email protected] 2 participants 2 messages Jul 15, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: Remove unnecessary params variable from process_adv_report()

From: Johan Hedberg <[email protected]>

The params variable was just used for storing the return value from the hci_pend_le_action_lookup() function and then checking whether it's NULL or not. We can simplify the code by checking the return value directly.

---
 net/bluetooth/hci_event.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
net/bluetooth/hci_event.c +2 -5
index 8980bd24b8c0..bf2926b2e4a9 100644
@@ -4314,14 +4314,11 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
 	 * device found events.
 	 */
 	if (hdev->le_scan_type == LE_SCAN_PASSIVE) {
-		struct hci_conn_params *param;
-
 		if (type == LE_ADV_DIRECT_IND)
 			return;
 
-		param = hci_pend_le_action_lookup(&hdev->pend_le_reports,
-						  bdaddr, bdaddr_type);
-		if (!param)
+		if (!hci_pend_le_action_lookup(&hdev->pend_le_reports,
+					       bdaddr, bdaddr_type))
 			return;
 
 		if (type == LE_ADV_NONCONN_IND || type == LE_ADV_SCAN_IND)
Signature · 1 line
1.9.3
maintainer
#1 lore raw

Hi Johan,

Quoted 8 lines

The params variable was just used for storing the return value from the hci_pend_le_action_lookup() function and then checking whether it's NULL or not. We can simplify the code by checking the return value directly.

---
net/bluetooth/hci_event.c | 7 ++-----

1 file changed, 2 insertions(+), 5 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel