]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Bluetooth: hci_core: add missing braces when using macro parameters
authorChristian Eggers <ceggers@arri.de>
Mon, 14 Jul 2025 20:27:44 +0000 (22:27 +0200)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 16 Jul 2025 19:37:37 +0000 (15:37 -0400)
Macro parameters should always be put into braces when accessing it.

Fixes: 4fc9857ab8c6 ("Bluetooth: hci_sync: Add check simultaneous roles support")
Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
include/net/bluetooth/hci_core.h

index 052c91613bb9d28ad6319c07c96b4c6fca2ce91b..367ca43f45d1116d1ffcc35c75e87a1d6370160f 100644 (file)
@@ -829,20 +829,20 @@ extern struct mutex hci_cb_list_lock;
 #define hci_dev_test_and_clear_flag(hdev, nr)  test_and_clear_bit((nr), (hdev)->dev_flags)
 #define hci_dev_test_and_change_flag(hdev, nr) test_and_change_bit((nr), (hdev)->dev_flags)
 
-#define hci_dev_clear_volatile_flags(hdev)                     \
-       do {                                                    \
-               hci_dev_clear_flag(hdev, HCI_LE_SCAN);          \
-               hci_dev_clear_flag(hdev, HCI_LE_ADV);           \
-               hci_dev_clear_flag(hdev, HCI_LL_RPA_RESOLUTION);\
-               hci_dev_clear_flag(hdev, HCI_PERIODIC_INQ);     \
-               hci_dev_clear_flag(hdev, HCI_QUALITY_REPORT);   \
+#define hci_dev_clear_volatile_flags(hdev)                             \
+       do {                                                            \
+               hci_dev_clear_flag((hdev), HCI_LE_SCAN);                \
+               hci_dev_clear_flag((hdev), HCI_LE_ADV);                 \
+               hci_dev_clear_flag((hdev), HCI_LL_RPA_RESOLUTION);      \
+               hci_dev_clear_flag((hdev), HCI_PERIODIC_INQ);           \
+               hci_dev_clear_flag((hdev), HCI_QUALITY_REPORT);         \
        } while (0)
 
 #define hci_dev_le_state_simultaneous(hdev) \
-       (!test_bit(HCI_QUIRK_BROKEN_LE_STATES, &hdev->quirks) && \
-        (hdev->le_states[4] & 0x08) && /* Central */ \
-        (hdev->le_states[4] & 0x40) && /* Peripheral */ \
-        (hdev->le_states[3] & 0x10))   /* Simultaneous */
+       (!test_bit(HCI_QUIRK_BROKEN_LE_STATES, &(hdev)->quirks) && \
+        ((hdev)->le_states[4] & 0x08) &&       /* Central */ \
+        ((hdev)->le_states[4] & 0x40) &&       /* Peripheral */ \
+        ((hdev)->le_states[3] & 0x10))         /* Simultaneous */
 
 /* ----- HCI interface to upper protocols ----- */
 int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr);