Skip to content

Commit

Permalink
Simplify fake_wiimote_mgr_handle_hci_cmd_accept_con
Browse files Browse the repository at this point in the history
  • Loading branch information
xerpi committed Oct 22, 2021
1 parent 25c7bb1 commit 0daad6b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions source/fake_wiimote_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,13 +868,10 @@ static inline bool does_hci_con_handle_belong_to_fake_wiimote(u16 hci_con_handle

static bool fake_wiimote_mgr_handle_hci_cmd_accept_con(const bdaddr_t *bdaddr, u8 role)
{
int ret;
int ret, i;

/* Check if the bdaddr belongs to a fake wiimote */
for (int i = 0; i < MAX_FAKE_WIIMOTES; i++) {
if (memcmp(bdaddr, &fake_wiimotes[i].bdaddr, sizeof(bdaddr_t) != 0))
continue;

if (does_bdaddr_belong_to_fake_wiimote(bdaddr, &i)) {
/* Connection accepted to our fake wiimote */
DEBUG("Connection accepted for fake Wiimote %d!\n", i);

Expand Down

0 comments on commit 0daad6b

Please sign in to comment.