Commit c61e4112 authored by Erick Archer's avatar Erick Archer Committed by Luiz Augusto von Dentz

Bluetooth: hci_core: Prefer array indexing over pointer arithmetic

Refactor the list_for_each_entry() loop of hci_get_dev_list()
function to use array indexing instead of pointer arithmetic.

This way, the code is more readable and idiomatic.
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarErick Archer <erick.archer@outlook.com>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
parent 8f7dfe17
......@@ -828,8 +828,8 @@ int hci_get_dev_list(void __user *arg)
if (hci_dev_test_flag(hdev, HCI_AUTO_OFF))
flags &= ~BIT(HCI_UP);
(dr + n)->dev_id = hdev->id;
(dr + n)->dev_opt = flags;
dr[n].dev_id = hdev->id;
dr[n].dev_opt = flags;
if (++n >= dev_num)
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment